-
-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
Description
i keep getting the Failed assertion: line 309 pos 12: 'track != null': is not true. error whenever i try to play my recorded track using Quickplay.fromTrack().
Here's a snippet of my code
String recording;
Track track;
Future<void> startRecording() async {
recording = Track.tempFile(WellKnownMediaFormats.adtsAac);
track =
Track.fromFile(recording, mediaFormat: WellKnownMediaFormats.adtsAac);
recorder.onRequestPermissions = (_) => requestPermissions();
try {
await recorder.record(track);
print(recorder.isRecording);
} catch(e)
{
print(e);
}
}
After recording with the above method then i call the method below
Future<void> stopRecording() async {
try {
print(recorder.isRecording);
await recorder.stop();
print(track);
} catch (error) {
print(error);
} finally {
QuickPlay.fromTrack(track);
}
}
Note: All methods are in the same class.