dataAsList method
Returns data as a typed list matching the current sampleSize.
- 8-bit Uint8List
- 16-bit Int16List
- 32-bit Float32List
Throws UnsupportedError if sampleSize is not one of the above.
Implementation
TypedDataList dataAsList() => switch (sampleSize) {
8 => data.asUint8List(waveLength),
16 => data.asInt16List(waveLength),
32 => data.asFloat32List(waveLength),
_ => throw UnsupportedError('Unexpected sampleSize: $sampleSize'),
};