Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Audioplayers ByteSource is not supported on ios

Tags:

flutter

dart

I have been trying to implement amazon polly in my flutter project but I am unable to run it on iOS devices. It works perfectly fine on android. I am using a Byte source which is not supported on iOS.

BytesSource source = BytesSource(bytes);
await audioPlayer.play(source);

In the documentation it is written:

/// Source containing the actual bytes of the media to be played.
///
/// This is currently only supported for Android (SDK >= 23).

So my question is How do I play bytes in iOS or macOS devices with audioplayers package? Do I need to use another package or is a workaround available?

like image 532
Harsh Vardhan Avatar asked Oct 17 '25 15:10

Harsh Vardhan


1 Answers

The only way that is currently available outside of Android is to write those bytes to a file and then use that file in AudioPlayers with DeviceFileSource.

You can follow this issue to get notified about when BytesSource is implemented for other platforms: https://github.com/bluefireteam/audioplayers/issues/1269

like image 122
spydon Avatar answered Oct 21 '25 04:10

spydon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!