Audio Manager
Manages the playback of audio output from files or TTS
Types
Link copied to clipboard
Link copied to clipboard
interface OnAudioOperationDoneCallback
Link copied to clipboard
interface OnSetAudioRouteCallback
Link copied to clipboard
interface PCMDataOutputCallback
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface TTSOutputCallback
Functions
Link copied to clipboard
open fun addPlayStatusListener(listener: AudioManager.PlayStatusListener, @Nullable executor: Executor)
Adds a PlayStatus listener
Link copied to clipboard
open fun clearQueue(@NonNull callback: AudioManager.OnAudioOperationDoneCallback, @Nullable executor: Executor)
Removes all output from the audio queue.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Plays audio output.
Link copied to clipboard
Redirect the PCM data output to PCMDataOutputCallback Setting callback to null will reset audio output to normal
Link copied to clipboard
Redirect the TTS text to TTSOutputCallback Setting callback to null will reset audio output to normal
Link copied to clipboard
Link copied to clipboard
open fun setAudioRoute(audioRoute: Int, @NonNull callback: AudioManager.OnSetAudioRouteCallback, @Nullable executor: Executor)
Link copied to clipboard
Link copied to clipboard
Adds a silent sound of specified length at the start of each played audio if there was no audio playing for at least that specified length.
Link copied to clipboard
open fun skipCurrentOutput(@NonNull callback: AudioManager.OnAudioOperationDoneCallback, @Nullable executor: Executor)
Skips the output at the front of the queue
Link copied to clipboard
open fun stopOutputAndClearQueue(@NonNull callback: AudioManager.OnAudioOperationDoneCallback, @Nullable executor: Executor)
Stops playing the current output immediately and clears any queued output