音频播放器无法工作,AVPlayerItem.Status.failed iOS

Wag*_*cio 5 avaudioplayer flutter

我正在尝试使用插件音频播放器来录制我录制的音频(它在 android 上完美运行),但是当我尝试播放音频时出现此错误:

"iOS => call setVolume, playerId 57c0b5cc-3c75-4f8f-bf99-ad8ddbcb7709"
"iOS => call setUrl, playerId 57c0b5cc-3c75-4f8f-bf99-ad8ddbcb7709"
""
2022-06-23 18:27:00.168194-0300 Runner[16264:695114] flutter: AVPlayerItem.Status.failed
Run Code Online (Sandbox Code Playgroud)

知道我能做些什么来解决这个问题吗?

await audioPlayer2.setVolume(1.0);
      await audioPlayer2.setUrl(filepath, isLocal: true);
      await audioPlayer2.play(filepath, isLocal: true);
      audioPlayer2.onPlayerStateChanged.listen((event) {
        setState(() {
          _isPlaying = false;
        });
Run Code Online (Sandbox Code Playgroud)

ser*_*io4 -1

我没有使用setUrl然后播放,而是只使用了这个:

final _audioPlayer = AudioPlayer()..setReleaseMode(ReleaseMode.stop);
await _audioPlayer.play(UrlSource(widget.postData.audioURL));
Run Code Online (Sandbox Code Playgroud)