sound doesn't play anything

Previous topic - Next topic

phaelax

I've tried loading an mp3 for music and wavs for sound but can't get either one to play.  No errors, just no sound.

MrTAToad

Can you make the MP3 and WAV available - need to check they are in the right format.

Bursar

Have you put the audio files in the application.app directory (and optionally in the Media directory if you're using that)? Have you typed the name of the directory and/or file correctly (including case)?

It's a little difficult to guess what else might be going on without code.

phaelax

Found the problem, it doesn't seem to like sub-folders.  The files were in the app directory, but I had a sub-directory called 'sfx'.  I tried loading the sounds like: "sfx\stuff.wav" but that wouldn't work.  If I remove the files from the sfx folder and just keep them in the root of the app folder then I can load them fine.  Any insight as to why I can't load them from sub-folders?

Ian Price

You can load from sub-folders, as that's exactly what I do. I do this with sfx, gfx and data. Sub directories within the Media directory work as expected.

Are you sure that the main directory is set to Media - 

Code (glbasic) Select
SETCURRENTDIR ("Media")

and then are you using
Code (glbasic) Select
LOADSOUND "sfx/stuff.wav",value,repeat? If not, make sure that it is.

And GLBasic uses "/" not "\"
I came. I saw. I played.

phaelax

My sfx folder isn't in the media directory it's off the root directory the application is in, which is the current working directory. So i dont see a need to use setcurrentdir. 

I tried both types of slashes before just to make sure.

Scott_AW

Then try SETCURRENTDIR ("SFX")?
Current Project, Orbital Contract Defense
http://gamejolt.com/games/adventure/code-name-ocd/9887/

BlackShadow now open source/resource(requires duke3d)
http://gamejolt.com/games/adventure/black-shadow-3d/9885/

Bursar

Sub folders do work, but I suspect that the wav file is in the wrong format. GLB seems to be rather picky about the settings. Try opening them with Audacity and changing them to 16bit files and resaving.

Leginus

took the words out of my mouth.  I had to convert a few wav files using audacity.  I didn't post it to the forums at the time as I assumed it was me being.......well being me :)

phaelax

as i've already said, the wav files work fine when in the root directory, so it's obviously not the format.

Bursar

Can you post the code that loads the sounds you're trying play?

Kitty Hello

Test with DOESFILEEXIST ?

MrTAToad

And make sure the case is correct - on various platforms, file and directory naming case sensitive.

phaelax

I'm not sure what the problem was, but it's working as expected now. Strange.