Skip to main content Link Menu Expand (external link) Document Search Copy Copied
foodSink property - FlutterSoundPlayer class - player library - Dart API
menu
foodSink

foodSink property

StreamSink<Food>? get foodSink

The sink side of the Food Controller. Deprecated.

This the output stream that you use when you want to play asynchronously live data. This StreamSink accept two kinds of objects :

  • FoodData (the buffers that you want to play)
  • FoodEvent (a call back to be called after a resynchronisation)

Example:

This example shows how to play Live data, without Back Pressure from Flutter Sound

await myPlayer.startPlayerFromStream(codec: Codec.pcm16, numChannels: 1, sampleRate: 48000);

myPlayer.foodSink.add(FoodData(aBuffer));
myPlayer.foodSink.add(FoodData(anotherBuffer));
myPlayer.foodSink.add(FoodData(myOtherBuffer));
myPlayer.foodSink.add(FoodEvent((){_mPlayer.stopPlayer();}));

Implementation

@deprecated
StreamSink<Food>? get foodSink =>
    _foodStreamController != null ? _foodStreamController!.sink : null;
flutter_sound 9.25.3