Skip to main content Link Menu Expand (external link) Document Search Copy Copied
deleteRecord method - FlutterSoundRecorder class - recorder library - Dart API
menu
deleteRecord

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 closeRecorder() 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');

See also


Implementation

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