deleteRecord method

Future<bool?> deleteRecord({
  1. required String fileName,
})

Delete a temporary file

Delete a temporary file created during startRecorder(). the argument must be a file name without any path. This function is seldom used, because closeAudioSession() delete automaticaly all the temporary files created.

Example:

     await myRecorder.startRecorder(toFile: 'foo'); // This is a temporary file, because no slash '/' in the argument
     await myPlayer.startPlayer(fromURI: 'foo');
     await myRecorder.deleteRecord('foo');

Implementation

Future<bool?> deleteRecord({required String fileName}) async {
  _logger.d('FS:---> deleteRecord');
  await _waitOpen();
  if (!_isInited) {
    throw Exception('Recorder is not open');
  }
  var b = await TauRecorderPlatform.instance.deleteRecord(this, fileName);
  _logger.d('FS:<--- deleteRecord');
  return b;
}