I have an app that plays sounds for starting a yacht race. It worked fine until today, when in testing the app ran fine but made no sounds. It turned out media audio was muted. These sounds are important because you can't expect a skipper starting a race to be watching the phone screen all the time.
Here is the code for one sound:
Code to play one sound. File is loaded earlier.:
Sub Beep
mpBeep.SetVolume(1,1)
mpBeep.play
End Sub
I thought setvolume(1,1) would over ride the user mute but apparently not.
Is ther a way to make sure the sounds will always be heard?
I am trying to set the volume using the code below to max in an alarm however the "mp.SetVolume(1,1)" line does not work (does not change the volume to max) I added the same code to the "SimpleAlarm" that SuSu wrote and it doesn't work there either. I've attached a zip of SuSu's "SimpleAlarm"...
Mediaplayer setvolume seems to do nothinhg so I commented it out.
This code works.
Code to set phone volume and unmute:
Sub Start
Try
p.setvolume(p.VOLUME_MUSIC,VolRange ,True)
p.setmute(p.VOLUME_MUSIC, False)
Catch
ToastMessageShow("START. Do Not Disturb is on.", True)
End Try
'mpStart.SetVolume(1,1)
mpStart.play
End Sub
Sub VolRange As Int
Return p.GetMaxVolume(p.VOLUME_MUSIC)
End Sub