# feedFromStream method

1. @Deprecated('Use [feedUint8FromStream()]')

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

    @Deprecated('Use [feedUint8FromStream()]')
    Future<void> feedFromStream(Uint8List buffer) async {
      var lnData = 0;
      var totalLength = buffer.length;
      while (totalLength > 0 && !isStopped) {
        var bsize = totalLength > _bufferSize ? _bufferSize : totalLength;
        //_waitForFood = true;
        var ln = await _feed(buffer.sublist(lnData, lnData + bsize));
        //_waitForFood = false;
        assert(ln >= 0);
        lnData += ln;
        totalLength -= ln;
      }
    }