dataAsList method

TypedDataList dataAsList()

Returns data as a typed list matching the current sampleSize.

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'),
};