feedFromStream method

Future<void> feedFromStream(
  1. Uint8List buffer
)

Used when you want to play live PCM data synchronously.

This procedure returns a Future. It is very important that you wait that this Future is completed before trying to play another buffer.

Example:

  • This example shows how to play Live data, with Back Pressure from Flutter Sound
  • This example shows how to play some real time sound effects synchronously.
await myPlayer.startPlayerFromStream(codec: Codec.pcm16, numChannels: 1, sampleRate: 48000);

await myPlayer.feedFromStream(aBuffer);
await myPlayer.feedFromStream(anotherBuffer);
await myPlayer.feedFromStream(myOtherBuffer);

await myPlayer.stopPlayer();

Implementation

Future<void> feedFromStream(Uint8List buffer) async {
  await _feedFromStream(buffer);
}