RxAudio class

Constructors

RxAudio({int nonFinalChunkFlag = 0x05, int finalChunkFlag = 0x06, bool streaming = false})

Properties

finalChunkFlag int
final
hashCode int
The hash code for this object.
no setterinherited
nonFinalChunkFlag int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
streaming bool
final

Methods

attach(Stream<List<int>> dataResponse) Stream<Uint8List>
Attach this RxAudio to the Frame's dataResponse characteristic stream. If this RxAudio was created with streaming: true then the returned broadcast Stream will produce elements continuously, otherwise it will be a single subscription stream that produces a single Uint8List element containing the entire audio clip received. Both types of Stream are Done when the finalChunkFlag is received from Frame indicating the end of the audio feed
detach() → void
Detaches the RxAudio from the Frame dataResponse Stream permanently. For streaming==false RxAudios, this has no effect because the controller of the Stream closes when the single clip is completely received. For streaming==true RxAudios, after the RxAudio has been attached to dataResponse, the client can call listen() and cancel() many times and the controller for the stream will not be closed. But when finished, it can be closed with detach and cannot be listened to again.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

toWavBytes({required Uint8List pcmData, int sampleRate = 8000, int bitsPerSample = 16, int channels = 1}) Uint8List
Create the contents of a WAV files corresponding to the provided pcmData