Impossible to play wav

nico78

Active Member
Licensed User
Longtime User
Hello,

Impossible to me to play wav, where is the error?
The file is added of course with the file manager

B4X:
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:

nico78

Active Member
Licensed User
Longtime User
mp3 doesn't work also, have you a file that work?
 
Upvote 0

nico78

Active Member
Licensed User
Longtime User
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

cbal03

Member
Licensed User
Longtime User
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

cbal03

Member
Licensed User
Longtime User
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
Top