AudioPlaybackManager class

Manages audio playback for TTS services Matches iOS AudioPlaybackManager from Features/TTS/Services/AudioPlaybackManager.swift

This is a shared utility that works with any TTS backend. It plays audio data generated by TTS synthesis.

Constructors

AudioPlaybackManager()

Properties

currentTime double
Current playback time in seconds
no setter
duration double
Total duration of current audio in seconds
no setter
hashCode int
The hash code for this object.
no setterinherited
isPlaying bool
Whether audio is currently playing
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stateStream Stream<AudioPlaybackState>
Stream of playback state changes
no setter

Methods

dispose() Future<void>
Dispose resources
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDecodeError(Object? error) → void
Called when a decode error occurs
onPlaybackComplete(bool success) → void
Called when playback finishes naturally
pause() Future<void>
Pause current playback
play(Uint8List audioData, {int sampleRate = 22050, int numChannels = 1}) Future<void>
Play audio data asynchronously (async/await) audioData PCM16 or WAV audio data to play sampleRate Sample rate of the audio (default: 22050 for TTS) numChannels Number of audio channels (default: 1 for mono)
playWithCompletion(Uint8List audioData, void completion(bool success), {int sampleRate = 22050, int numChannels = 1}) → void
Play audio data with completion callback
resume() Future<void>
Resume paused playback
stop() Future<void>
Stop current playback
toString() String
A string representation of this object.
inherited

Operators

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