15

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?

Monster Brain
  • 1,950
  • 18
  • 28
an00b
  • 11,338
  • 13
  • 64
  • 101

1 Answers1

20

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;
Roman Nurik
  • 29,665
  • 7
  • 84
  • 82
  • Wow! Thank you very much. +51. Do you also happen to know the answer to this related question? [TTS output always going to A2DP](http://stackoverflow.com/questions/6963461/tts-output-always-going-to-a2dp) – an00b Aug 08 '11 at 13:48
  • 3
    Don't know off-hand, but I've added a bounty to the question. – Roman Nurik Aug 08 '11 at 17:33