Skip to content

Can't play recorded track #35

Description

@mtkgeek

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions