N nico78 Active Member Licensed User Longtime User Nov 6, 2011 #1 Hello, Impossible to me to play wav, where is the error? The file is added of course with the file manager Code: Copy Sub Activity_Create(FirstTime As Boolean) sd.Initialize (1) id=sd.Load(File.DirAssets, "Ding.wav") Log(id) 'return 1 ret=sd.Play ( id, 0.5, 0.5, 1, 0, 0) Log(ret) 'return always 0 End Sub Last edited: Nov 6, 2011
Hello, Impossible to me to play wav, where is the error? The file is added of course with the file manager Code: Copy Sub Activity_Create(FirstTime As Boolean) sd.Initialize (1) id=sd.Load(File.DirAssets, "Ding.wav") Log(id) 'return 1 ret=sd.Play ( id, 0.5, 0.5, 1, 0, 0) Log(ret) 'return always 0 End Sub
Erel B4X founder Staff member Licensed User Longtime User Nov 7, 2011 #2 Can you upload your project with the wav file (File - Export as zip)? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Nov 8, 2011 #4 Seems like a bug or limitation of the native SoundPool. Try to convert the file to OGG or MP3. Upvote 0
N nico78 Active Member Licensed User Longtime User Nov 8, 2011 #5 mp3 doesn't work also, have you a file that work? Upvote 0
N nico78 Active Member Licensed User Longtime User Nov 8, 2011 #6 I found the explanation on this forum, it is not possible to load a file and to play it at once! If I puts a stop point between the load and the play, it works How to know if the file is ready to be to play? Upvote 0
I found the explanation on this forum, it is not possible to load a file and to play it at once! If I puts a stop point between the load and the play, it works How to know if the file is ready to be to play?
Erel B4X founder Staff member Licensed User Longtime User Nov 8, 2011 #7 I missed that point. You can use a timer with an interval of 500 ms. Try to load the sound until the PlayId is different than 0 (then disable the timer). Upvote 0
I missed that point. You can use a timer with an interval of 500 ms. Try to load the sound until the PlayId is different than 0 (then disable the timer).
C cbal03 Active Member Licensed User Longtime User Jun 23, 2012 #8 Can't load a .wav file ? Hi guys, I found something interesting while attempting to play a sound file. This works: mp.Load(File.DirAssets, "ballgame.mid") mp.Play This does not: (i get file not found error on the device) mp.Load(File.DirAssets, "crowdCheer1.wav") mp.Play If I replace the filename then it works. Both files exist in the same folder. The same thing happens when I try an .mp3 file. Only the .mid file will play while the others cause a file not found error. I checked with android dev to ensure I'm supplying the correct compression for the files. But this error says the file isn't found. :sign0163: Upvote 0
Can't load a .wav file ? Hi guys, I found something interesting while attempting to play a sound file. This works: mp.Load(File.DirAssets, "ballgame.mid") mp.Play This does not: (i get file not found error on the device) mp.Load(File.DirAssets, "crowdCheer1.wav") mp.Play If I replace the filename then it works. Both files exist in the same folder. The same thing happens when I try an .mp3 file. Only the .mid file will play while the others cause a file not found error. I checked with android dev to ensure I'm supplying the correct compression for the files. But this error says the file isn't found. :sign0163:
C cbal03 Active Member Licensed User Longtime User Jun 23, 2012 #9 Can't load a .wav file ? FIXED Duh.. I renamed the .wav file in all lowercase and also changed the reference to the file to all lowercase. Now it works. Upvote 0
Can't load a .wav file ? FIXED Duh.. I renamed the .wav file in all lowercase and also changed the reference to the file to all lowercase. Now it works.