1

I keep getting this error when I try to play local audio files which are saved on a custom directory

Error (-11849) Operation Stopped 
 Stack #0      AudioPlayer._load (package:just_audio/just_audio.dart:850:9)
<asynchronous suspension>
#1      AudioPlayer._setPlatformActive.setPlatform (package:just_audio/just_audio.dart:1435:28)
<asynchronous suspension>

this is the file path

/var/mobile/Containers/Data/Application/55D5A61A-733C-4129-85AE-5757210F3C1A/Documents/Networking/Voice Notes/161/1673927478163913.aac

this is how I initialise just_audio

  Future<void> initAudioPlayer() async {
    print(widget.filePath);
    await player.setFilePath(widget.filePath);
  }

just_audio: ^0.9.23

  • Solved this by changing the audio recording library to [record](https://pub.dev/packages/record), flutter sound was creating invalid audio files – Dayveed Daniel Jan 18 '23 at 06:30

1 Answers1

0

Error -11849 is AVError.Code.failedToLoadMediaData.

It's difficult to say much without seeing code, but it seems likely to be some problem with being able to access the file... either it doesn't exist on the device, or the path is incorrect, or the app does not have access to the directory in which the file resides.

See also

Chuck Batson
  • 2,165
  • 1
  • 17
  • 15