beepSound (again)

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

beepSound (again)

Post by rrBUSS9EE » Wed May 09, 2012 2:44 am

I realize there are other threads here but the solutions provided are not working for me…

Code: Select all

on alertme
     set the beepSound to specialFolderPath("engine") & "/TriBeep.aiff"
     --do other stuff
end alertme
This handler simply stops at 'set the beepSound'. Yes, the file is in the copy files pane of the standalone settings. If I comment out that line, the rest of the handler executes.

What am I missing here?

LC 5.5; OS X 10.7.3; xCode 4.3.2

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

Re: beepSound (again)

Post by Dixie » Wed May 09, 2012 8:47 am

hi...
Set this in your 'preOpenStack' handler

Code: Select all

set the beepSound to specialFolderPath("engine") & "/TriBeep.aiff"
after that whenever you want a beep, just issue the 'beep' command

Code: Select all

on mouseDown
     beep
end mouseDown
be well

Dixie

rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Re: beepSound (again)

Post by rrBUSS9EE » Wed May 09, 2012 1:11 pm

Thanks Dixie,

But unfortunately setting the beepsound does not work from any handler, resulting only in the stoppage of script execution.

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

Re: beepSound (again)

Post by Klaus » Wed May 09, 2012 1:21 pm

Did you try with parens?
...
set the beepSound to (specialFolderPath("engine") & "/TriBeep.aiff")
...
Sometimes the engine is a bit picky in this respect :D
And don't forget that iOS is CASE sensitive!

Just to be sure:
The sound itself plays fine with:
...
play (specialFolderPath("engine") & "/TriBeep.aiff")
...
?


Best

Klaus

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

Re: beepSound (again)

Post by Dixie » Wed May 09, 2012 2:01 pm

I can assure you that this is the correct syntax...

Code: Select all

      set the beepSound to specialFolderPath("engine") & "/shortbeep.aiff"
Refer to page 36 of the iOS relase notes, paragraph 'System alert support...

Check for upper/lowerase use in the names of the files and the names when you are calling them...

Dixie

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

Re: beepSound (again)

Post by Klaus » Wed May 09, 2012 2:18 pm

The docs are far away from being impeccable 8)

rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Re: beepSound (again)

Post by rrBUSS9EE » Wed May 09, 2012 2:24 pm

Thanks folks. I have it sorted out.

rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Re: beepSound (again)

Post by rrBUSS9EE » Wed May 09, 2012 2:55 pm

Ashamed to say that this was a typo of mine in the file extension (aiff vs aif).

But what is odd is that I checked the result immediately after the 'set' command and that line did not execute, instead the set command just silently failed.

Oddly enough:

play "soundfileThatDoesNotExist.aif"
answer the result

returns empty. You would think it would return some string indicating a file not found error. I am new to LC and this is a little troublesome. Not only the result not returning an error string, but with 'set the beepsound to "soundfileThatDoesNotExist.aif"', not even being able to check the result, with script execution just stopping.

Kinda makes it tough to debug things.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4178
Joined: Sun Jan 07, 2007 9:12 pm

Re: beepSound (again)

Post by bn » Wed May 09, 2012 3:33 pm

Hi rrBUSS9EE,
instead the set command just silently failed.
that is a problem on iOS. What I do is to put a handler at the card or stack level:

Code: Select all

on errorDialog
   put the params into field "xxx"
end errorDialog
assuming you provide a field "xxx" for every card if the script is at the stack level (I use a group whose background behavior is true) or a field "xxx" for the card if the script is at the card level.
Although the error code is not very informative at least you know there is something going on. When the app is ready I delete the field and the script.
Kind regards

Bernd

rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Re: beepSound (again)

Post by rrBUSS9EE » Wed May 09, 2012 3:41 pm

Great tip! Thanks.

Post Reply