Does it matter what audio stream I use?

Go To StackoverFlow.com

0

The android audio manager has a large number of different audio streams available, including DTMF, SYSTEM, RING etc.

Not that I'm saying its a good idea, but is there any significant disadvantage to playing audio on a stream other than MUSIC? The standard appears to be to play on the MUSIC stream, but if, for example, I want to use the ringer volume, is there any disadvantage to just playing on the RING stream instead?

There are a number of cases where playing on streams other than music offer some advantages in addition to the case I provided above, but I don't want to risk breaking more important functionality if I can help it.

I'd be curious to hear whether anyone has any experience playing on and/or manipulating other streams, and what side affects, if any, they've encountered (or incurred...)

2012-04-04 22:48
by Sam Judd


0

Why do you need it? I think media stream is enough for any of your purposes.

Look, for example you use ring stream. And for example your program controls it volume. He sets "no volume" => it means that he goes into "vibrate mode" and he cant hear incoming rings because of your application

2012-04-04 22:57
by pleerock
Well for example if you want to play a sound that is somewhat like a ringtone so you want it to respect the ringtone volume the user has set. If the user wants to turn off the volume, its ok if they don't hear our notification. I'm aware that if I blatantly change the user's volume without restting it, they won't be happy. I'm more curious to hear what will happen if some important sound tries to play while I'm using the stream, or requests audio focus and I don't respect it etc - Sam Judd 2012-04-04 23:03
Ads