audio_waveforms
audio_waveforms copied to clipboard
Recording on iOS simulator not working
Describe the bug Recording does not work on ios simulator, the recording starts but the waveform or sign of audio being picked up is not showing and when I stop the recording and inspect the file path I do see the recorded audio but always with 28 bytes and the file does not play.
To Reproduce Steps to reproduce the behavior:
//1
final RecorderController recorderController =
RecorderController()
..androidEncoder = AndroidEncoder.aac
..androidOutputFormat = AndroidOutputFormat.mpeg4
..iosEncoder = IosEncoder.kAudioFormatMPEG4AAC;
//2
await recorderController.record();
//3
final path = await recorderController.stop();
NOTE: the path is to the apps document directory which I can navigate via my macbook Expected behavior I expect the audio to be recorded and saved to the path
Smartphone (please complete the following information):
- Device: iPhone 15 Pro Max (Simulator)
- OS: 17.2
- Version [e.g. 22]
@codeswot Can you please try on real device also check if you can record after providing path in record
function.
I can confirm same issue on a real device, and when path
is provided to the record
function.
https://github.com/SimformSolutionsPvtLtd/audio_waveforms/issues/288
@codeswot The issue might have to be the extension you have set. Please make sure that the file extension you're using is supported by the encoder you're using and the underlying platform.
I have exactly the same problem. This used to work just fine:
_recorderController = RecorderController()
..androidEncoder = AndroidEncoder.aac
..androidOutputFormat = AndroidOutputFormat.mpeg4
..iosEncoder = IosEncoder.kAudioFormatMPEG4AAC
..sampleRate = 44100;
And trying to record into
_recordFilePath = await getApplicationDocumentsDirectory().then((value) => '${value.path}/recording.m4a');
await _recorderController.record(path: _recordFilePath);
So the file extension shouldn't be the problem. Any advice?