A very simple example showing how to play Live Data without back pressure. It feeds a live stream, without waiting that the Futures are completed for each block. This is simpler than playing buffers synchronously because the App does not need to await that the playback for each block is completed playing another one.
This example get the data from an asset file, which is completely stupid : if an App wants to play a long asset file he must use startPlayer().
Feeding Flutter Sound without back pressure is very simple but you can have two problems :
- If your App is too fast feeding the audio channel, it can have problems with the Stream memory used.
The App does not have any knowledge of when the provided block is really played.
For example, if it does a “stopPlayer()” it will loose all the buffered data.
The complete example source is there