Khaled Kandil
Khaled Kandil

Reputation: 13

How can I make the Headphone with Speaker works together to play the sound?

I need to make the speaker with the headphone play the sound together in the code, I don't even know if it's feasible or not?

Upvotes: 0

Views: 106

Answers (1)

Purvil Bambharolia
Purvil Bambharolia

Reputation: 681

It is absolutely feasible. Because if it wouldn't have been then when someone calls you on your android phone, if you have noticed, the ringtone can be heard on both the headphone as well as the speaker.

What you need to do is set the mediaplayer's AudioStreamType to AudioManager.STREAM_RING

    player.setAudioStreamType(AudioManager.STREAM_RING);
    player.start();

Upvotes: 3

Related Questions