Re: "play sound"
Re: "play sound"
- Subject: Re: "play sound"
- From: JollyRoger <email@hidden>
- Date: Sat, 16 Mar 2002 20:21:56 -0600
On 3/16/2002 7:24 PM, "Mr Tea" <email@hidden> wrote:
>
This from JollyRoger
>
>
> For anyone interested, I've written a small scriptable
>
> application called Play Sound <http://MicrocosmSoftware.com/playsound/>
>
>
Yo ho ho! 15 men on a dead man's chest! Avast ye! Thanks, JR. This could
>
liberate my copy of iTunes
Woohoo! =)
>
One thing, though. In OS X, if I run a script that doesn't tell 'Play
>
Sound' to quit (ie, like the examples on the web page) I get these results:
>
>
tell application "Play Sound" to play sound "ChuToy"
>
>
-->"A fatal error occured: -192
-192 is (resNotFound) Resource not found **Resource Manager Errors (other
than I/O)**
My guess is Mac OS X just has no equivalent of the Mac OS 9 System file in
which system sounds are stored. All this function does is look in the
current resource file (or any file lower than it in the chain) for a 'snd '
resource with the name specified.
>
tell application "Play Sound" to play sound 6
>
>
-->"A fatal error occurred: -204"
-204 is (resProblem) Problem loading the resource **Sound Manager Errors**
Again, Mac OS X probably has no equivalent of the Mac OS 9 System file in
which system sounds are stored. This function looks in the current resource
file (or any file lower than it in the chain) for a 'snd ' resource with the
resource ID specified.
>
...and if I specify a sound to play by file path (needs 'alias' in front
>
of it to work OMM) the fatal error number given is 0
It doesn't need to be an alias in Mac OS 9. Must be an X thing. - Poor X
users are subjected to so much crap, I really wonder why people are putting
themselves through such hell sometimes... But anyway...
So it does play the sound, right? If not, try running the "Play Sound File"
example script provided. I've run it successfully on 3 Mac OS X systems.
About the "A fatal error occurred: 0" result: The reason you are getting
error 0 is not that there is an error; but the app is returning a 0 (noErr)
result *as if* it is an error. It's a somewhat harmless bug (a mistaken
omission due to haste on my part!) and is easy to fix:
Open PlaySound.c and look for this line:
failure:
Just before that line, add the following line:
return err;
Recompile and you are done.
If you'd like, I can email you a fixed version - just let me know. I don't
have time tonight to upload it to the server.
>
If I run scripts like these repeatedly, the errors pile up as I go,
>
giving results that look like this:
>
>
"A fatal error occured: 00-204-204-204-204-204-204"
>
>
Crumbs. Any idea what's going on?
No idea why the errors are "piling up". Doesn't happen on OS 9. Maybe it's
a bug in Mac OS X Script Editor?
JR
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.