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.