arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

The Ï„ Player API

feedFromStream().

hashtag
feedFromStream()

  • Dart API: feedFromStream()arrow-up-right.

This is the verb that you use 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:

  • shows how to play Live data, with Back Pressure from Flutter Sound

  • shows how to play some real time sound effects synchronously.

</div>

This examplearrow-up-right
This examplearrow-up-right
Dart
Javascript

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();

        Lorem ipsum ...