Help needed with FMOD library

grrnfr

Member
Licensed User
Hello,

I need to set the master volume of the loud speaker. I tried the FMOD library, all seems to work fine except the master volume.
I tried with the following code :


Sub App_Start
Form1.Show
fmod.New1
End Sub

Sub Button1_Click
fmod.Play(AppPath & "\chord.wav")
End Sub

Sub Button2_Click
fmod.Volume = 0
End Sub

Sub Button3_Click
fmod.Volume = 100
End Sub

Sub Button4_Click
Msgbox( "Volume = " & fmod.Volume )
End Sub


When I use button2 or button3, further using Button4 gives the right value but Button1 doesn't care of it.

Cand someone help me ?

Thanx
 

grrnfr

Member
Licensed User
My code (http://www.b4x.com/forum/share-your-creations/5221-music-player-play-list.html#post30578) sets the volume each time a file starts to play.

I don't think that fmod.dll undertakes to remember any settings between playing files.

You just need to remember what volume setting you want in a global variable...

Mike.

Hello,
Thanx for your answer.
Do you mean that the volume is automaticaly reset to the max each time a sound is played so I have to set it to the right volume after the play() method is invoked ?

Like this :

Sub Button1_Click
fmod.New1
fmod.Play(AppPath & "\chord.wav")
fmod.Volume = 100
End Sub


Thanx
 

mjcoon

Well-Known Member
Licensed User
... I have to set it to the right volume after the play() method is invoked ?

Yes, I think that is exactly what you have proved that you have to do (and is how my program does it).

(My program allows the user to choose the volume and stores the value in a global variable. Then that variable is used to set the volume for each file playing. But of course a different file might itself be louder or quieter in which case the user might want to adjust again!)

Mike.
 

grrnfr

Member
Licensed User
Yes, I think that is exactly what you have proved that you have to do (and is how my program does it).

(My program allows the user to choose the volume and stores the value in a global variable. Then that variable is used to set the volume for each file playing. But of course a different file might itself be louder or quieter in which case the user might want to adjust again!)

Mike.

Hello,
Thanx for your answer.
I have try this method and it works but not the way I expected...
With this method, volume can be set between 0 and 255. 255 is the volume of the PDA that must be set manualy.
I would like to set the PDA master volume and not the volume of the played sound.
I want to set the PDA volume to 0 and set it to the max only when needed (alarms) because when it is set to the max, it generates noise in the phone speaker.
Do you think that there is a solution to my problem ?

Best regards
 

mjcoon

Well-Known Member
Licensed User
I would like to set the PDA master volume and not the volume of the played sound.
I want to set the PDA volume to 0 and set it to the max only when needed (alarms) because when it is set to the max, it generates noise in the phone speaker.
Do you think that there is a solution to my problem ?

Best regards

I don't know the answer to that. I suggest that you ask a separate question that is not under the heading of an FMOD topic. Maybe there's something in one of the several hardware-related libraries.

Mike.
 

grrnfr

Member
Licensed User
I don't know the answer to that. I suggest that you ask a separate question that is not under the heading of an FMOD topic. Maybe there's something in one of the several hardware-related libraries.

Mike.

Hello,
Thanx for your help.
You're right, I'm going to start another post.
 
Top