When set to OPUS format, audio does not record in OPUS format
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,
OPUSformat - Actual: 16000 Hz sample rate, 24 kb/s bit rate, mono,
amr_wbformat
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,
OPUSformat - Actual: 48000 Hz sample rate, 89 kb/s bit rate, stereo,
aacformat
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.