getting beep to work

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

getting beep to work

Post by marksmithhfx » Sat Jan 28, 2012 3:58 am

Hi, does anyone know how to get beep to work on an iPad? (I think I have to put something into beepSound first but not sure what to put to get the regular beep).

Thanks

-- Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: getting beep to work

Post by Mark » Sat Jan 28, 2012 10:51 am

Hi,

Beepsound is only for Windows and I've never used it. If there is an interest, I can compile an external to beep and vibrate.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

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

Re: getting beep to work

Post by Dixie » Sat Jan 28, 2012 12:00 pm

Hi...
Copy the sound that you wish to use as a beep sound to your app through the 'copy files' pane... then say, in the preOpenStack handler...

Code: Select all

  set the beepSound to specialFolderPath("engine") & "/sound/shortbeep.aiff"
Then whenver you issue the 'beep' command, your sound will play.

be well

Dixie

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: getting beep to work

Post by Mark » Sat Jan 28, 2012 12:08 pm

Hi Dixie,

Where did you find this? Have you actually tried it? According to the LiveCode dictionary, the beepSound "sets the method used to produce sound when the beep command is used" and can only be either "system" or "internal".

Edit: I found it in the LC 5.0.2 help files. I really believe this needs to be documented better. All it says is: "Note: The iPhone does not have a default system alert sound so if a sounds is required one must be specified by using the beepSound property."

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: getting beep to work

Post by Jellicle » Sat Jan 28, 2012 10:53 pm

Mark, with respect, where else other than the iOS release notes do you think iOS-specific documentation should be published?

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: getting beep to work

Post by Mark » Sun Jan 29, 2012 2:17 am

Hi Gerry,

The beepSound property is defined in the built-in LiveCode dictionary. In LC 5.0.2 and maybe one or two earlier versions this entry in the dictionary includes one sentence about iOS.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: getting beep to work

Post by Jellicle » Sun Jan 29, 2012 10:33 pm

Mark, the release notes spell out in detail how the beep sound works on iOS. Don't you consult the release notes?

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: getting beep to work

Post by Mark » Sun Jan 29, 2012 11:03 pm

Hi Gerry,

Surely, I read the release notes, but I think the dictionary needs to be complete. That once sentence really is too limited. If RunRev modifies the dictionary, they should do it the right way. The dictionary still is that place where to look first. The title of the Release Notes implies that you read them to be informed about the latest changes in that particular release. Otherwise, the title would have been LiveCode Syntax Manual Supplement.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: getting beep to work

Post by marksmithhfx » Sun Jan 29, 2012 11:24 pm

Dixie wrote:Hi...
Copy the sound that you wish to use as a beep sound to your app through the 'copy files' pane... then say, in the preOpenStack handler...

Code: Select all

  set the beepSound to specialFolderPath("engine") & "/sound/shortbeep.aiff"
Then whenver you issue the 'beep' command, your sound will play.
Thanks Dixie, I figured it was going to be something like that. I appreciate the coding example as I would certainly have struggled with it.

Relatedly, does anyone have an .aiff file that implements a beep sound? (that is not something I have tucked away for a rainy day, nor would know how to make).

Thanks

-- Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

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

Re: getting beep to work

Post by Dixie » Mon Jan 30, 2012 2:52 am

Hi Mark...

I too am no musician...:-) I made this a while ago, it works for me on the iphone...

be well

Dixie
Attachments
shortbeep.aiff.zip
(2.67 KiB) Downloaded 274 times

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: getting beep to work

Post by Jellicle » Mon Jan 30, 2012 4:14 am

Mark wrote:Hi Gerry,
I think the dictionary needs to be complete.
Sure, I agree. There are lots of platform-specific things in there that aren't in the dictionary. RR are slow at updating it, for whatever reason, or they think release notes are a better way to provide platform-specific information. If that's the case they should, as you suggest, call them something else.

g
14" MacBook Pro
Former LiveCode developer.
Now recovering.

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: getting beep to work

Post by marksmithhfx » Mon Jan 30, 2012 9:53 am

Dixie wrote:Hi Mark...

I too am no musician...:-) I made this a while ago, it works for me on the iphone...

be well

Dixie
Thanks Dixie will give it a go!!
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: getting beep to work -- not really

Post by marksmithhfx » Tue Jan 31, 2012 3:46 am

Switching gears completely for a moment. I have the following code which is attempting to store some fields in a database. Works fine, unless one of the fields has an apostrophe in it and then it causes the write to fail. I know there is a concept of "escaping" characters, but I am not sure how it would work in this case.

Code: Select all

  put "INSERT INTO master (delivery_date,mothers_name,mothers_phin,mothers_mhsc,mothers_dob,care_provider,note)" & \
           merge("VALUES ('[[globaldate]]', '[[tmaternalname]]', '[[tmaternalphin]]', '[[tmaternalmhsc]]', " & \
           "'[[tmaternaldob]]', [[tcareprovider]]', '[[tnote]]')") into tCmd
   revExecuteSQL gConnectID, tCmd
Any suggestions?

Thanks
-- Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am

Re: getting beep to work

Post by marksmithhfx » Tue Jan 31, 2012 4:27 am

Hi Dixie, just a quick note to say I copied and pasted your example code without really thinking about it and was a little surprised when my app stopped working :(

I should have looked more closely, there was no folder /sound in my "engine" directory, so removing that part of the example got things going again. Sure works nice :D

Thanks again,
-- Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Post Reply