Author Topic: sound doesn't play anything  (Read 2453 times)

Offline phaelax

  • Mc. Print
  • *
  • Posts: 36
    • View Profile
sound doesn't play anything
« 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.

MrTAToad

  • Guest
Re: sound doesn't play anything
« Reply #1 on: 2010-Sep-21 »
Can you make the MP3 and WAV available - need to check they are in the right format.

Offline Bursar

  • Mr. Drawsprite
  • **
  • Posts: 63
    • View Profile
Re: sound doesn't play anything
« Reply #2 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.

Offline phaelax

  • Mc. Print
  • *
  • Posts: 36
    • View Profile
Re: sound doesn't play anything
« Reply #3 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?

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4144
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: sound doesn't play anything
« Reply #4 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 "\"
I came. I saw. I played.

Offline phaelax

  • Mc. Print
  • *
  • Posts: 36
    • View Profile
Re: sound doesn't play anything
« Reply #5 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.

Offline Scott_AW

  • Mr. Polyvector
  • ***
  • Posts: 214
    • View Profile
    • SAW Game Design
Re: sound doesn't play anything
« Reply #6 on: 2010-Oct-01 »
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/

Offline Bursar

  • Mr. Drawsprite
  • **
  • Posts: 63
    • View Profile
Re: sound doesn't play anything
« Reply #7 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.

Offline Leginus

  • Dr. Type
  • ****
  • Posts: 288
    • View Profile
Re: sound doesn't play anything
« Reply #8 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 :)

Offline phaelax

  • Mc. Print
  • *
  • Posts: 36
    • View Profile
Re: sound doesn't play anything
« Reply #9 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.

Offline Bursar

  • Mr. Drawsprite
  • **
  • Posts: 63
    • View Profile
Re: sound doesn't play anything
« Reply #10 on: 2010-Oct-04 »
Can you post the code that loads the sounds you're trying play?

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10697
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: sound doesn't play anything
« Reply #11 on: 2010-Oct-04 »
Test with DOESFILEEXIST ?

MrTAToad

  • Guest
Re: sound doesn't play anything
« Reply #12 on: 2010-Oct-04 »
And make sure the case is correct - on various platforms, file and directory naming case sensitive.

Offline phaelax

  • Mc. Print
  • *
  • Posts: 36
    • View Profile
Re: sound doesn't play anything
« Reply #13 on: 2010-Oct-07 »
I'm not sure what the problem was, but it's working as expected now. Strange.