openPlaybackBytes method
Future<PlaybackSession>
openPlaybackBytes({
- required Uint8List bytes,
- required WaveformDocument document,
override
This method opens a playback session over bytes that are already in memory.
Web has no filesystem, so this method is the only playback path there. On native, this method uses the same engine as openPlayback. It reads from a copy of the bytes, and it does not stream a file.
The audio that plays is byte-identical to the audio that exportWav writes on every target, because every target renders through the same C loop. Only the device is different. Native targets use miniaudio. Web uses a WebAudio graph.
Implementation
@override
Future<PlaybackSession> openPlaybackBytes({
required Uint8List bytes,
required WaveformDocument document,
}) async {
bytePlaybacks.add((bytes.length, document));
return openPlayback(
sourcePath: '${bytes.length} bytes',
document: document,
);
}