playing a sound

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
dgm
Posts: 8
Joined: Sat Nov 11, 2006 5:13 am

playing a sound

Post by dgm » Tue Aug 05, 2008 2:40 am

Why can't I simply play a sound? I download a file from the internet. I import the sound into my program as an audiofile. then I write the code
on mouseUp
play audioclip "oops"
end mouseUp

And.. nothing happens. I get a click, and nothing else. Why doesn't this work?
It's a .wav file. I have tried it as is, opening with quicktime, opening with iTunes, etc. but still just a quick clicking sound and then nothing. What gives??
As a side note, I can get some sound files to play, but only some.
Also, how can I see which audio files I have imported? I can see fields, images, etc. in the Inspector, but no audio files. Thanks.

dgm
Posts: 8
Joined: Sat Nov 11, 2006 5:13 am

playing a sound

Post by dgm » Tue Aug 05, 2008 3:07 am

If I do this (with or without the audioclip keyword, both will work)...

play audioclip "C:\Documents and Settings\Desktop\Sounds\dave.wav"
and it will play the sound.

But when I try another sound form the same folder...

play audioclip "C:\Documents and Settings\\Desktop\Sounds\oops.wav"
and nothing happens. (of course, Quicktime will play either sound)

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Tue Aug 05, 2008 5:44 am

To display which audioclips and videoclips are embedded in your stack, go to the 'Preferences' tab 'Application Browser' and tick the checkboxes for 'Show audio clips' and 'Show video clips'.
Now you can see the audio and video clips in your stack by using the 'Application browser' which you can find in the 'Tools' menu.

When you use audioClip and videoClip features, you're not using QuickTime directly. And Revolution may not support all variations of the AU, WAV and AIFF audio compression formats.
So if QuickTime can play it, try using a player control and point that to your audio file. Then you can use the 'start player' and 'stop player' commands to do your thing.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

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

Post by Klaus » Tue Aug 05, 2008 10:18 am

Hi dgm,

"play ac XYZ" will only play uncompressed AIFF and WAVE files!

If possible, use player-objects, which require QuickTime to be installed, as Jan already suggested.


Best

Klaus

dgm
Posts: 8
Joined: Sat Nov 11, 2006 5:13 am

Playing a sound

Post by dgm » Wed Aug 06, 2008 7:59 pm

Thanks for the info. The sound that was giving me fits was a IMA ADPCM formattted sound. Revolution doesn't like it. I experimented with importing a sound and with direct access and both work with plain-jane PCM formats of wav. So I guess I just need to be careful about what format the sounds are. BTW, the sound won't play without adding the .wav to the name. (or some other endings I assume)

DGM

Post Reply