Open fabiojansenbr opened 5 months ago
did you find solution ?
Any update on this? i am also facing the same issue
Same issue but with ByteSource: Flutter 3.19.5 audioplayers 6.0.0 iOS: 17.4
"PlatformException (PlatformException(DarwinAudioError, Failed to set source. For troubleshooting, see https://github.com/bluefireteam/audioplayers/blob/main/troubleshooting.md, AVPlayerItem.Status.failed on setSourceUrl: Unknown error, null))"
I'm encountering the same error: PlatformException(DarwinAudioError, Failed to set source. For troubleshooting, see https://TROUBLESHOOTING_GUIDE, AVPlayerItem.Status.failed on setSourceUrl: Unknown error, null)
This issue occurs when I attempt to play audio using BytesSource
on iOS. Working on Android, but failing on iOS.
Flutter 3.19.6 audioplayers 6.0.0 iOS: 17.4
@novas1r1 Have you found any solution?
@narendra-vaniya nope, sorry. I switched to soundpool
You may can add some files in order to have a chance to reproduce the problem. Best regards.
@narendra-vaniya nope, sorry. I switched to soundpool
Thank @novas1r1
I've found a solution, we must provide the mimeType.
Sample.
await _audioPlayer.play(
BytesSource(bytes, mimeType: 'audio/mp3'),
);
It would be nice to handle this case directly within the BytesSource class if the mimeType is empty.
Checklist
Current bug behaviour
Im getting this error when try to play audio on IOS only in a physical device. On simulator works fine.
Runner(Flutter)[4087]: DeviceFileSource(path: /var/mobile/Containers/Data/Application/387E8E16-458F-4F36-80AB-C2152228C985/Documents/audios/audio17120075.m4a), Apr 1 20:40:44 Runner(Flutter)[4087] : PlatformException(DarwinAudioError, Failed to set source. For troubleshooting, see https://github.com/bluefireteam/audioplayers/blob/main/troubleshooting.md, AVPlayerItem.Status.failed on setSourceUrl, null)<\M-b\M^@\M-
Expected behaviour
The audio should play properly
Steps to reproduce
flutter run
on the code sampleCode sample
Code sample
```dart void main() { } ```Affected platforms
iOS
Platform details
No response
AudioPlayers Version
5.2.1
Build mode
No response
Audio Files/URLs/Sources
No response
Screenshots
No response
Logs
Full Logs
``` my full logs or a link to a gist ``` Flutter doctor: ``` Output of: flutter doctor -v ```Related issues / more information
No response
Working on PR
no way