No sound plays in iPad with "beep" command

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
rleiman
Posts: 56
Joined: Fri Dec 14, 2012 11:28 am
Contact:

No sound plays in iPad with "beep" command

Post by rleiman » Tue Jan 01, 2013 2:47 pm

I tried to get a sound to play on an iPad using this lesson:

http://lessons.runrev.com/s/lessons/m/4 ... ios-device

and used the following code in the "Beep" button after importing the sound file according to the lesson:

Code: Select all

on mouseUp
   set the beepsound to specialFolderPath("engine") & "/mysound.mp3"
   beep
end mouseUp
No sound is heard even with the iPad volume turned up to maximum.

Is the lesson correct?

Thanks.

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

Re: No sound plays in iPad with "beep" command

Post by Dixie » Tue Jan 01, 2013 3:23 pm

The syntax is correct... but try using an .aiff file instead of type mp3.

Code: Select all

on mouseUp
   set the beepSound to specialFolderPath("engine") & "/shortbeep.aiff"
   beep
end mouseUp
Make sure that you have copied the sound file into the stack using the 'copy files' pane in 'standalone application settings'.

be well

Dixie

rleiman
Posts: 56
Joined: Fri Dec 14, 2012 11:28 am
Contact:

Re: No sound plays in iPad with "beep" command

Post by rleiman » Tue Jan 01, 2013 3:30 pm

Hi Dixie,

Thanks for the reply. Since I had only mp3 files I found the "Play" command.

I was able to get it working with the "Play" command using it like this:

Code: Select all

on mouseUp
   play specialFolderPath("engine") & "/mysound.mp3"
end mouseUp

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

Re: No sound plays in iPad with "beep" command

Post by Klaus » Tue Jan 01, 2013 5:35 pm

Hi Emad,

since you may use this more than once, you could write a little handler for your "custom beep"
and put it into the stackscript like this:

Code: Select all

on myBeep
   play specialFolderPath("engine") & "/mysound.mp3"
end myBeep
Now you can call it from every object/card etc. :

Code: Select all

on mouseup
   myBeep
end mouseup
Best

Klaus

rleiman
Posts: 56
Joined: Fri Dec 14, 2012 11:28 am
Contact:

Re: No sound plays in iPad with "beep" command

Post by rleiman » Tue Jan 01, 2013 10:05 pm

Thanks very much Klaus.

Very helpful. :)

Post Reply