I want to record audio while pressing a button. here is my code.
var tempDir = await getTemporaryDirectory();
String path = '${tempDir.path}/audio.acc';
await _myRecorder.openRecorder();
await _myRecorder.startRecorder(
toFile: path,
codec: Codec.aacMP4,
);
// after recording another button to stop the recording. to stop this recording i used the code:
await _myRecorder.stopRecorder();
_myRecorder.closeRecorder();
_myRecorder = null;
i get my above mentioned error while i call "await _myRecorder.startRecorder" function. please help. thank you.
I recently had the same problem, it seems you should not append the file type at the end when declaring your path and should change:
To:
Secondly some codecs currently are not supported but I am struggling to find which ones as their codec compatibility page is down:
https://flutter-sound.canardoux.xyz/guides_codec.html