AndroidSpeechPlayer

open class AndroidSpeechPlayer : SpeechPlayer

Default player used to play voice instructions when a connection to Polly is unable to be established.

This instruction player uses TextToSpeech to play voice instructions.

Constructors

AndroidSpeechPlayer
Link copied to clipboard
open fun AndroidSpeechPlayer(context: Context, language: String, voiceListener: VoiceListener)
Creates an instance of AndroidSpeechPlayer.

Functions

onDestroy
Link copied to clipboard
open fun onDestroy()
Stops and shuts down TTS
onOffRoute
Link copied to clipboard
open fun onOffRoute()
To be called during an off-route event, mutes TTS
play
Link copied to clipboard
open fun play(voiceInstructions: VoiceInstructions)
Plays the given voice instruction using TTS
abstract fun play(speechAnnouncement: VoiceInstructions)
Will play the given string speechAnnouncement.
setMuted
Link copied to clipboard
open fun setMuted(isMuted: Boolean)
Mutes or un-mutes the AndroidSpeechPlayer, canceling any instruction currently being voiced,and preventing subsequent instructions from being voiced

Properties

isMuted
Link copied to clipboard
private open val isMuted: Boolean