Soundplay right code, no sound?
I think I added Soundpool correctly, The audio libraries are included. The wav file is a short msg.wav in the apps files folder. No errors show when compiling. This test program compiles correctly but
I don't hear any sound, either in the emulator or when I install the app independently on the Android. I know the button is pressing because it changes color. Here below are the included sound lines from a larger program. Of course some of these are in different parts of the code as the variables are declared higher up.
The button press is a sub almost at the bottom of the code. Newbie by the way, but I really want to know how to play short sounds using SoundPool.
My speakers are on and the volume is up on both the laptop and the Android by the way.
----------
Code:
Dim sp As SoundPool
Dim PressId As Int 'Id for keypress sound
sp.Initialize(16)
'load sounds
sp.Load(File.DirAssets,"msg.wav")
(down below in the subs after the layout is showing with the buttons0
Sub Button7_Click
sp.Play(PressId,1,1,1,0,1)
End Sub
-----------