Playing Sound
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Playing Sound
I have went through the lesson on playing sounds. In the article it says it is picky to play sounds. I have tried wav, mp3, and aiff files with no luck. I also, have uploaded the sound file to the stack. What am I doing wrong?
on mouseUp
play audioclip "sound.wav"
end mouseUp
on mouseUp
play audioclip "sound.wav"
end mouseUp
Re: Playing Sound
Hi Marcelloe,
is this on the mobile platform (iOS/Android)? Please always add this info!
If yes, then this does not work at all, since on the mobile platform
Livecode does NOT play internal/imported sounds!
Best
Klaus
is this on the mobile platform (iOS/Android)? Please always add this info!
If yes, then this does not work at all, since on the mobile platform
Livecode does NOT play internal/imported sounds!
Best
Klaus
Re: Playing Sound
Yes, it is for IOS. Sorry I thought I put that in. So, there is no way to add sound, even if I add the sound file to the stack. Can you explain further. In the lesson they talk about playing sound on mobile devices.
Thanks for your help
Mark
Thanks for your help
Mark
Re: Playing Sound
Hi Mark,
yep, "internal" sounds cannot be palyed on iOS.
But then simply use external files
Example 1:
1. you have a sound file "sound.wav"
2. in the standalone builder settings "Copy files", add this (and other) file(s)!
3. Then you can access that files with this specialfolderpath():
...
play (specialfolderpath("engine") & "/sound.wav")
...
Example 2:
You have some more sound files in a folder named "sounds" and
you added that complete FOLDER in the standalone builder, you can access
the sounds inside of this folder:
...
play (specialfolderpath("engine") & "/sounds/sound.wav")
...
You get the picture
Best
Klaus
yep, "internal" sounds cannot be palyed on iOS.
But then simply use external files
Example 1:
1. you have a sound file "sound.wav"
2. in the standalone builder settings "Copy files", add this (and other) file(s)!
3. Then you can access that files with this specialfolderpath():
...
play (specialfolderpath("engine") & "/sound.wav")
...
Example 2:
You have some more sound files in a folder named "sounds" and
you added that complete FOLDER in the standalone builder, you can access
the sounds inside of this folder:
...
play (specialfolderpath("engine") & "/sounds/sound.wav")
...
You get the picture
Best
Klaus
Re: Playing Sound
Klaus:
Thanks for explaining that for me.
Thanks for explaining that for me.
Re: Playing Sound
This is the script I used, but I can't get it to work on my ipad. Not sure what I am doing wrong. I added the files in the standalone "copy files" section.
on touchEnd
play (specialfolderpath("engine") & "/sound.wav")
end touchEnd
on touchEnd
play (specialfolderpath("engine") & "/sound.wav")
end touchEnd
Re: Playing Sound
Hi Mark,
I am not sure if iOS supports WAV files!?
Try MP3 or M4A, that should work!
Best
Klaus
I am not sure if iOS supports WAV files!?
Try MP3 or M4A, that should work!
Best
Klaus