0

I want to separate the audio paths that is used for ringtone/touch sounds and the music playback. The aim is to get this path separated, so that when mute is applied on the main audio path, ringtone /touch sound is not muted. For eg: when music playback is muted, and skype incoming call comes, the ringtone should be heard.

We are using mastervolume for applying volume on both the paths. I tried setting the ringtone path to AUDIO_OUTPUT_FLAG_DIRECT so that it uses the direct output thread and does not get mixed with the main audio. But this is causing the music playback also to mute. Is this the right approach? Could you please tell where can I separate the ringtone/ touch sound and music playback in Audioflinger?

llrs
  • 3,308
  • 35
  • 68
  • 1
    Which mastervolume are you referring to? The audio framework has support for muting individual stream types (e.g. mute `MUSIC` but not `RING`). – Michael Mar 10 '14 at 13:55
  • What I meant to say is, I am using setMasterVolume and not setStreamVolume, hence if I apply a mute it will affect all output paths. Separate paths have to be used for ringtone and music playback. In this context, is it possible for directoutputthread and mixerthread to exist simultaneously? The aim is to make sure that when I mute audio playback it should not mute ringtone or touch sounds. Any other approach for this? – user3401963 Mar 10 '14 at 14:26
  • Just to make sure; you're making your own custom Android ROM, right? (i.e. this is not an app). Muting a given stream type (e.g. `MUSIC`) if the current audio mode is changed to `AUDIO_MODE_RINGTONE` is certainly something that should be possible to do in the `AudioPolicyManager`. – Michael Mar 10 '14 at 14:33
  • No, the idea is not to give both ringtone and music playback to mixerthread and get it mixed. they should have separate paths. We cannot use setstreamvolume as setmastervolume has been used by the vendor everywhere and changing it would be difficult now. – user3401963 Mar 11 '14 at 06:12

0 Answers0