adding sound not working

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
star0629
Posts: 22
Joined: Thu Nov 28, 2013 9:04 pm

adding sound not working

Post by star0629 » Sat Jan 11, 2014 3:43 pm

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.
Last edited by star0629 on Sat Jan 11, 2014 4:10 pm, edited 1 time in total.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: adding sound not working

Post by Klaus » Sat Jan 11, 2014 3:50 pm

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

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: adding sound not working

Post by Dixie » Sat Jan 11, 2014 3:53 pm

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...

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: adding sound not working

Post by Klaus » Sat Jan 11, 2014 4:07 pm

AH! Good catch! :D

Post Reply