Play audio through tts
There is one embedded TTS engine integrated in Voice Assistant, other apps can also play through the
same TTS engine, for example, play Nav audio guidance, Voice Assistant will base on the stream type
it filled to manage audio focus. Please integrate the following Intent and broadcast to support the play.
- Action: com.telenav.assistant.PLAY_AUDIO
- Bundle Fields:
- Code Example of how to send the Intent to Voice Assistant:
| val intentAction = "com.telenav.assistant.PLAY_AUDIO"
val assistantIntent = Intent(intentAction)
assistantIntent.putExtra("text", textToSpeak)
assistantIntent.putExtra("stream_type",streamType)
assistantIntent.putExtra("mode",mode)
context.sendBroadcast(assistantIntent)
|