AudioManager

Manages the playback of audio output from files or TTS

Types

Link copied to clipboard
annotation class AudioRoute
Link copied to clipboard
interface PCMDataOutputCallback
Link copied to clipboard
annotation class PlayStatus
Link copied to clipboard
interface PlayStatusListener : NativeMethodsReceiver.NativeListener
Link copied to clipboard
interface TTSOutputCallback

Functions

Link copied to clipboard
open fun addPlayStatusListener(listener: AudioManager.PlayStatusListener)

open fun addPlayStatusListener(listener: AudioManager.PlayStatusListener, @Nullable executor: Executor)
Adds a PlayStatus listener
Link copied to clipboard
open fun clearQueue()
Removes all output from the audio queue.
Link copied to clipboard
open fun getAudioRoute(): Int
Link copied to clipboard
open fun onContextDestroy()
Link copied to clipboard
open fun playOutput(audioOutput: AudioOutput)
Plays audio output.
Link copied to clipboard
open fun redirectPCMDataOutput(callback: AudioManager.PCMDataOutputCallback)
Redirect the PCM data output to PCMDataOutputCallback Setting callback to null will reset audio output to normal
Link copied to clipboard
open fun redirectTTSOutput(callback: AudioManager.TTSOutputCallback)
Redirect the TTS text to TTSOutputCallback Setting callback to null will reset audio output to normal
Link copied to clipboard
open fun removePlayStatusListener(listener: AudioManager.PlayStatusListener)
Link copied to clipboard
open fun setAudioRoute(audioRoute: Int)
Link copied to clipboard
open fun setHfpDelay(hfpDelay: Int)
Link copied to clipboard
open fun skipCurrentOutput()
Skips the output at the front of the queue
Link copied to clipboard
open fun stopOutputAndClearQueue()
Stops playing the current output immediately and clears any queued output