feedChunk method

Future<void> feedChunk(
  1. Uint8List chunk
)

Feeds an audio chunk to the player for playback.

chunk: The audio data to be played, represented as a Uint8List.

Implementation

Future<void> feedChunk(Uint8List chunk) async {
  try {
    // Invoke the native method to feed the audio chunk
    await _channel.invokeMethod(
        'feedAudioChunk', Platform.isAndroid ? {'chunk': chunk} : chunk);
  } catch (e) {
    // Log any errors that occur while feeding the chunk
    log("Error feeding chunk: ${e.toString()}");
  }
}