GLBasic forum

Main forum => GLBasic - en => Topic started by: phaelax on 2010-Sep-21

Title: sound doesn't play anything
Post by: phaelax on 2010-Sep-21
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.
Title: Re: sound doesn't play anything
Post by: MrTAToad on 2010-Sep-21
Can you make the MP3 and WAV available - need to check they are in the right format.
Title: Re: sound doesn't play anything
Post by: Bursar on 2010-Sep-21
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.
Title: Re: sound doesn't play anything
Post by: phaelax on 2010-Sep-27
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?
Title: Re: sound doesn't play anything
Post by: Ian Price on 2010-Sep-28
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 "\"
Title: Re: sound doesn't play anything
Post by: phaelax on 2010-Oct-01
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.
Title: Re: sound doesn't play anything
Post by: Scott_AW on 2010-Oct-01
Then try SETCURRENTDIR ("SFX")?
Title: Re: sound doesn't play anything
Post by: Bursar on 2010-Oct-01
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.
Title: Re: sound doesn't play anything
Post by: Leginus on 2010-Oct-01
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 :)
Title: Re: sound doesn't play anything
Post by: phaelax on 2010-Oct-04
as i've already said, the wav files work fine when in the root directory, so it's obviously not the format.
Title: Re: sound doesn't play anything
Post by: Bursar on 2010-Oct-04
Can you post the code that loads the sounds you're trying play?
Title: Re: sound doesn't play anything
Post by: Kitty Hello on 2010-Oct-04
Test with DOESFILEEXIST ?
Title: Re: sound doesn't play anything
Post by: MrTAToad on 2010-Oct-04
And make sure the case is correct - on various platforms, file and directory naming case sensitive.
Title: Re: sound doesn't play anything
Post by: phaelax on 2010-Oct-07
I'm not sure what the problem was, but it's working as expected now. Strange.