[BUG]:record file does not exist!!
flutter_sound: ^9.2.13
flutter:3.0.1
step 1: await stopRecorder()
step2: get the path from future returned
step3: check if exist

after i move the record logic from bloc to widget, the record file can be saved , but the player throw platform exception when playing the local file (the player can play remote file normally),

Same
flutter_sound: ^9.2.13 Flutter: 2.10.4
Same
flutter_sound: ^9.2.13 Flutter: 2.10.4
i have found a way, being tortured insane.you guess what,
1: the method stopRecorder() does not support creating a new directory, so the filed 'toFile' of startRecorder() should not contain another slash before the filename
2: the audio_session library is required, but not mentioned in the document
- Yes, the file path must be either a temporary file name (without any slash) or a complete file path pointing to a valid space in which we are allowed to write. You will probably use 'path_provider' plugin to build a correct file path. If you decide to specify a temporary file name, the full path will be returned during 'closeRecorder'.
- Yes, 'audio session' is now very useful (since 9.0.x). Someone promised to write a guide about this, with examples, but he/she never completed this. A Pull Request by someone else is needed.
I found that although the file exists, but it is empty.
var filePath = await _mRecorder.stopRecorder();
File file = File(filePath!);
if (file.existsSync()) {
print("file exist ${file.lengthSync()}");
}
flutter: file exist 0
- Yes, the file path must be either a temporary file name (without any slash) or a complete file path pointing to a valid space in which we are allowed to write. You will probably use 'path_provider' plugin to build a correct file path. If you decide to specify a temporary file name, the full path will be returned during 'closeRecorder'.
- Yes, 'audio session' is now very useful (since 9.0.x). Someone promised to write a guide about this, with examples, but he/she never completed this. A Pull Request by someone else is needed.
I did this fix and now the file exists but its empty too like @Allenxuxu comment
flutter_sound: ^9.2.13 issue on iOS only
I found that the file is in the tmp folder.
This way can get the file in iOS.
Directory tempDir = await getTemporaryDirectory();
String path = tempDir.path.replaceAll('Library/Caches', 'tmp');
String filePath = '${path}/${_mPath}';
This issue is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days.