Page 1 of 1
beepSound (again)
Posted: Wed May 09, 2012 2:44 am
by rrBUSS9EE
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
Re: beepSound (again)
Posted: Wed May 09, 2012 8:47 am
by Dixie
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
be well
Dixie
Re: beepSound (again)
Posted: Wed May 09, 2012 1:11 pm
by rrBUSS9EE
Thanks Dixie,
But unfortunately setting the beepsound does not work from any handler, resulting only in the stoppage of script execution.
Re: beepSound (again)
Posted: Wed May 09, 2012 1:21 pm
by Klaus
Did you try with parens?
...
set the beepSound to (specialFolderPath("engine") & "/TriBeep.aiff")
...
Sometimes the engine is a bit picky in this respect
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
Re: beepSound (again)
Posted: Wed May 09, 2012 2:01 pm
by Dixie
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
Re: beepSound (again)
Posted: Wed May 09, 2012 2:18 pm
by Klaus
The docs are far away from being impeccable

Re: beepSound (again)
Posted: Wed May 09, 2012 2:24 pm
by rrBUSS9EE
Thanks folks. I have it sorted out.
Re: beepSound (again)
Posted: Wed May 09, 2012 2:55 pm
by rrBUSS9EE
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.
Re: beepSound (again)
Posted: Wed May 09, 2012 3:33 pm
by bn
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
Re: beepSound (again)
Posted: Wed May 09, 2012 3:41 pm
by rrBUSS9EE
Great tip! Thanks.