Reputation: 13
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
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