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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With