audio_waveforms icon indicating copy to clipboard operation
audio_waveforms copied to clipboard

When set to OPUS format, audio does not record in OPUS format

Open jt274 opened this issue 1 year ago • 0 comments

Describe the bug When the recorder is set to the OPUS format, audio does not actually record in the OPUS format. No error is given. Additionally, the bit rate, sample rate and number of channels are incorrect.

To Reproduce

On Android 12 physical device:

await recorderController.record(
          path: '$tempDir/myfile.opus',
          sampleRate: 48000,
          bitRate: 10000,
          androidEncoder: AndroidEncoder.opus,
          iosEncoder: IosEncoder.kAudioFormatOpus,
        );

When using ffprobe to check the audio:

  • Expected: 48000 Hz sample rate, 10 kb/s bit rate, mono, OPUS format
  • Actual: 16000 Hz sample rate, 24 kb/s bit rate, mono, amr_wb format

On iPhone 11 iOS 17.4.1 physical device:

await recorderController.record(
          path: '$tempDir/myfile.opus',
          sampleRate: 48000,
          androidEncoder: AndroidEncoder.opus,
          iosEncoder: IosEncoder.kAudioFormatOpus,
        );

When using ffprobe to check the audio:

  • Expected: 48000 Hz sample rate, auto bit rate, mono, OPUS format
  • Actual: 48000 Hz sample rate, 89 kb/s bit rate, stereo, aac format

Expected behavior Audio should record in OPUS format, or a message should be printed to console about the format being changed. Bit rate and sample rate recorded should be what is specified in the bitRate and sampleRate parameters. Number of channels should be able to be specified as mono. Anything different should be specified in the documentation.

jt274 avatar Apr 22 '24 16:04 jt274