Android Question Set volume to a Media Player

Hedi

Member
Hello,

How can I set volume to a media player?

mp1.SetVolume(1,1)

I found a solution but I don't know how to convert it to B4A
Click here to see the solution (StackOverflow)


The code that works:
C#:
float volume1F = (float) volume1/100;
Then, you could do this to set the volume:
C#:
mp1.setVolume(volume1F, volume1F);

Thanks so much for your helps.
 

Hedi

Member
I don't understand the question. You can set the volume with MediaPlayer.SetVolume.

I am creating an app where I have three MediaPlayer objects in my activity. Let's call them mp1, mp2 and mp3.

I am playing all of the 3 MediaPlayers at the same time, so the user should be able to set how loud each of the sounds should be.

For example, mp1 should be low, mp2 should be loud, mp3 should be medium.
 
Upvote 0
Top