> For the complete documentation index, see [llms.txt](https://canardoux.gitbook.io/tau/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://canardoux.gitbook.io/tau/doc/pages/tau-api/player/start_player_from_stream.md).

# The τ Player API

startPlayerFromStream().

## `startPlayerFromStream()`

* Dart API: [startPlayerFromStream()](https://github.com/Canardoux/tau/tree/6bd245d293bcf9a123677735835549585d32b2ee/doc/pages/tau-api/player/pages/flutter-sound/api/player/FlutterSoundPlayer/startPlayerFromStream.html).

**This functionnality needs, at least, and Android SDK >= 21**

* The only codec supported is actually `Codec.pcm16`.
* The only value possible for `numChannels` is actually 1.
* SampleRate is the sample rate of the data you want to play.

Please look to [the following notice](https://github.com/Canardoux/tau/tree/6bd245d293bcf9a123677735835549585d32b2ee/doc/pages/tau-api/player/guides_play_stream/README.md)

*Example* You can look to the three provided examples :

* [This example](https://github.com/Canardoux/tau/tree/6bd245d293bcf9a123677735835549585d32b2ee/doc/pages/tau-api/player/flutter_sound_examples_playback_from_stream_2/README.md) shows how to play Live data, with Back Pressure from Flutter Sound
* [This example](https://github.com/Canardoux/tau/tree/6bd245d293bcf9a123677735835549585d32b2ee/doc/pages/tau-api/player/flutter_sound_examples_playback_from_stream_1/README.md) shows how to play Live data, without Back Pressure from Flutter Sound
* [This example](https://github.com/Canardoux/tau/tree/6bd245d293bcf9a123677735835549585d32b2ee/doc/pages/tau-api/player/flutter_sound_examples_sound_effects/README.md) shows how to play some real time sound effects.

*Example 1:*

[Dart](/tau/doc/pages/tau-api/player/start_player_from_stream.md#dart)

[Javascript](/tau/doc/pages/tau-api/player/start_player_from_stream.md#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 ...
```

\</div>

*Example 2:*

[Dart](/tau/doc/pages/tau-api/player/start_player_from_stream.md#dart)

[Javascript](/tau/doc/pages/tau-api/player/start_player_from_stream.md#javascript)

```

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

```

        Lorem ipsum ...
```

\</div>
