Skip to content

iOS interruption resume: compressed M4A continues growing but primary WAV stops growing #420

Description

@cyrus25

Environment

  • expo-audio-studio version: 3.2.1
  • Expo SDK version: 56.0.12
  • Platform & OS version: iOS 18.6.2
  • Device: iPhone

Description

On iOS, after an audio interruption ends, the compressed M4A recording continues growing, but the primary WAV output sometimes stops growing.

This causes the compressed happy-path recording to keep working, but the WAV recovery file becomes stale/incomplete after the interruption. In our app, WAV is used as a crash-recovery backup, so if the app crashes after this point, recovery may use an incomplete WAV even though the M4A continued recording.

I am not fully sure whether the same issue happens on Android yet.

Cross-Platform Validation

AudioPlayground Apps

Can this issue be reproduced in the AudioPlayground app?

  • Yes, on all platforms (Web, iOS, Android)
  • Yes, but only on specific platforms (please specify): iOS suspected
  • No, it only happens in my app

Reproduction steps in the AudioPlayground app:

  1. Start recording with both primary WAV output and compressed AAC/M4A output enabled.
  2. Trigger an iOS audio interruption, for example receive/accept/end a phone call, WhatsApp call, Google Meet, Discord, or similar.
  3. After the interruption ends, let recording continue for some time.
  4. Compare whether the compressed M4A continues growing while the WAV file size stops growing.

Is the behavior consistent across platforms?

  • Yes, the issue occurs the same way on all platforms I tested
  • No, the behavior differs between platforms: currently observed/suspected on iOS; Android not fully confirmed yet.

Configuration

const config = {
  sampleRate: recordingProfile.sampleRate,
  channels: 1,
  encoding: "pcm_16bit",
  keepAwake: true,
  showNotification: false,
  android: { audioFocusStrategy: "background" },
  outputDirectory,
  output: {
    primary: { enabled: Platform.OS === "ios" },
    compressed: {
      enabled: true,
      format: "aac",
      bitrate: recordingProfile.aacBitrate,
      preferRawStream: false,
    },
  },
  filename: audioId,
  autoResumeAfterInterruption: true,
  onRecordingInterrupted: onInterrupted,
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions