Page 1 of 1

adding sound not working

Posted: Sat Jan 11, 2014 3:43 pm
by star0629
I am trying to add background music which can be stopped and played by the player in the game i am creating. I googled how to do it and added the following example code to a button:

on mouseUp
play audioClip "/Users/davidwilliams/desktop/audiolesson/hello.wav"
end mouseUp

When i substituted in my stuff, all i got was thing crackling sound. Could someone please explain why, and what i can do.

thanks


edit: the file is not compressed.

Re: adding sound not working

Posted: Sat Jan 11, 2014 3:50 pm
by Klaus
Hi David,

LC is EXTREMELY picky, when it comes to PLAY audo and video files!
Is the WAV sound compressed somehow? LC does not like that. :D

Please post some info about the sound format if possible.


Best

Klaus

Re: adding sound not working

Posted: Sat Jan 11, 2014 3:53 pm
by Dixie
Hi...

You have the file you want to play on the desktop, so use

Code: Select all

play "/Users/davidwilliams/desktop/audiolesson/hello.wav"
use

Code: Select all

play audioclip  "hello.wav"
if you have imported the .wav file into your stack...

Re: adding sound not working

Posted: Sat Jan 11, 2014 4:07 pm
by Klaus
AH! Good catch! :D