Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default audio stream of TTS?

As far as I can tell, there are currently are 7 audio streams in Android:

STREAM_ALARM         (for alarms)
STREAM_DTMF          (for DTMF Tones)
STREAM_MUSIC         (for music playback)
STREAM_NOTIFICATION  (for notifications)
STREAM_RING          (for the phone ring)
STREAM_SYSTEM        (for system sounds)
STREAM_VOICE_CALL    (for phone calls)

I also know that it is possible to explicitly tell the TTS engine which stream to use:

params.put(TextToSpeech.Engine.KEY_PARAM_STREAM, String.valueOf(AudioManager.STREAM_ALARM));
mTts.speak(text, TextToSpeech.QUEUE_ADD, params);

What I couldn't find, however, is what stream is used by default when I don't specify an audio stream.

What is the default audio stream from Android's TextToSpeech engine?

Is there a way to query which stream is currently being used by Android's TextToSpeech engine?

UPDATE: TextToSpeech.Engine has a constant defined as DEFAULT_STREAM but it is unclear which of the 7 streams it is referring to. It has the same hex value (0x3) as STREAM_MUSIC, though. Is this it?

like image 417
an00b Avatar asked Jul 29 '11 18:07

an00b


1 Answers

STREAM_MUSIC is the default in the AOSP source, defined in TextToSpeech.java (line 164 as of this writing) in frameworks/base.git:

/**
 * Default audio stream used when playing synthesized speech.
 */
public static final int DEFAULT_STREAM = AudioManager.STREAM_MUSIC;
like image 54
Roman Nurik Avatar answered Sep 22 '22 17:09

Roman Nurik