AudioDataContainer class

Class that contain the streamed audio data.

The data receives a Uint8List whatever the format is. This raw data is stored into rawData and its format is the one used when initializing the recorder. This class also provide methods to convert the data to other formats based on the original recorder format. For example to convert to Int8List the data when the recorder is initialized with PCMFormat.f32le, you have to use toS8List method. Be aware that the conversion is compute expensive and should be avoided if possible initializing the recorder with the format desired.

When streaming with StreamingFormat.opus, rawData contains a length-prefixed Opus packet instead of PCM samples.

Constructors

AudioDataContainer(Uint8List u8Data)
The class which is used by the Stream to listen to the audio data.

Properties

hashCode int
The hash code for this object.
no setterinherited
length int
Return the lenght in byte of the audio data.
no setter
rawData Uint8List
Get the raw audio data whatever the format.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toF32List({required PCMFormat from}) Float32List
Convert the data to Float32List based on the from format.
toS16List({required PCMFormat from}) Int16List
Convert the data to Int16List based on the from format.
toS24List({required PCMFormat from}) Int8List
Convert the data to Int8List based on the from format.
toS24ListOnInt32({required PCMFormat from}) Int32List
Convert the data to Int32List based on the from format.
toS32List({required PCMFormat from}) Int32List
Convert the data to Int32List based on the from format.
toS8List({required PCMFormat from}) Int8List
Convert the data to Int8List based on the from format.
toString() String
A string representation of this object.
inherited
toU8List({required PCMFormat from}) Uint8List
Convert the data to Uint8List based on the from format.

Operators

operator ==(Object other) bool
The equality operator.
inherited