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

uint8ListSink property

StreamSink<Uint8List>? get uint8ListSink

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

Getter of one of the three StreamSink that you may use to feed a player from Stream.


This stream is used when you have interleaved audio data and you don't want a flow control. You can look to this small guide if you need precisions.

Return

The StreamSink that you may use to feed the player

example

await myPlayer.startPlayerFromStream
(
    codec: Codec.pcmFloat32
    numChannels: 2
    sampleRate: 48100
    interleaved: true,
);

myPlayer.uint8ListSink.add(myData);

See also


Implementation

//@Deprecated('Use [uint8ListSink]')
//StreamSink<Food>? get foodSink => _foodStreamController?.sink;

/// Getter of one of the three StreamSink that you may use to feed a player from Stream.
///
/// ----------------------------------------------------------------------------------------------
///
/// This stream is used when you have interleaved audio data and you don't want a flow control.
/// You can look to this [small guide](/tau/guides/guides_live_streams.html) if you need precisions.
///
/// ## Return
///
/// The StreamSink that you may use to feed the player
///
/// ## example
///
/// ```dart
/// await myPlayer.startPlayerFromStream
/// (
///     codec: Codec.pcmFloat32
///     numChannels: 2
///     sampleRate: 48100
///     interleaved: true,
/// );
///
/// myPlayer.uint8ListSink.add(myData);
/// ```
///
/// ## See also
///
/// - [float32Sink]
/// - [int16Sink]
/// - [feedF32FromStream()]
/// - [feedInt16FromStream()]
/// - [feedUint8FromStream()]
/// - You can also look to this [small guide](/tau/guides/guides_live_streams.html) if you need precisions.
///
/// ----------------------------------------------------------------------------------------------
StreamSink<Uint8List>? get uint8ListSink => _pcmUint8Controller?.sink;
taudio 10.3.0