[comp.sys.mac] 'snd ' resources

jmunkki@santra.UUCP (10/03/87)

Some of you were left quite puzzled after my previous posting of the 'snd '
resource generating custom soundwave routine (I call it simply "bong").

I'm now posting a new version that saves Hypercard and system beep type sounds
at both 11 and 22 Khz. To make these sounds you need Soundwave, ResEdit and
BinHex 4.0 or later. First download this article. Edit it so that only the part
after "(This file must be converted with BinHex 4.0)" is left. BinHex it. You
should now have a file called bong.code. IT IS NOT AN APPLICATION. A Soundwave
swci is similar to a HyperCard xcmd or xfcn in that it is not a stand-alone
application and must rely on the support of the host application.

Soundwave automatically recognizes "swci" resources pasted into it. Start
ResEdit and open bong.code. Select all the resources by shift or cmd-selecting
them and choose copy. The clipboard now contains all the resouces. Open
Soundwave with ResEdit. Choose "Paste" and then Quit from ResEdit. (Answer yes
to save changes if all went ok) Remember to do this on a copy of soundwave.

To use "bong", launch Soundwave and digitize or load a sound. Select the part of
it you want to use and choose "Bong" from the "Custom" menu. Select the format
you want to use (the sampling rate should match the rate of the 'snd ' type or
the sound will sound funny). You should now see the standard file dialog. Type
in the name of the sound and choose a folder. If the file already exists and
you click yes when asked if you want to replace the file, the file will NOT
be first deleted, but the new resource will be appended to it (this is sometimes
quite useful). The dialog will also contain many extra buttons inherited
from soundwave (the have no function in Bong). The new 'snd ' resource never
replaces an existing resource and it originally has the same name as the file
it is written to.

If you created a new file, use ResEdit to copy and paste the resource into the
correct file. System beeps must go into the system file and HyperCard sounds
should be either in the stack (recommended for final applications) or HyperCard
(recommended for debugging).

I hope I didn't forget anything this time.

Juri Munkki
jmunkki@santra.hut.fi
Helsinki University of Technology Computing Centre

Disclaimer: The opinions stated here might not represent the opinions of anyone
	    else and I might change my mind later...for now just believe me.

Disclaimer: The code in the posted program does not represent my average
	    programming style since it was only written as a quick hack and it
	    surprisingly worked with no debugging at all.

(This file must be converted with BinHex 4.0)

:#8*[EQFZBfpNC3!rN!J!N!J,"G2D!*!%!3#3!`TL!!!*BJ#3!k-!N!05"h"bEfC
TE'8#!*!$8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bC#!a-8YSHJ#3"QJ"-!#!!G#
%$dKjF'9b3f&bC#!b-NYSHQm!N!8)!!J!'!%JL"Y$Eh"jFQPRD(3JU6%j1$FJ5R9
bD5"0G@jVDfP0!*!&)!!)!$!"))JM8'pbG'P[ER-JN!1T-6Ni0b"8D'PZDb"8C@0
SEQpXEfGTCA0X!*!&8!!)!(!"))K#9'KTFb"MGA0dEfdJFQpeG'PZC5"cBACPFb"
dD'8JFf9XC@0dD@pZ)'&c)'%J*h0ZC#!R)(*PFfpeFQ0P)'CTE'8Z!*!&L!!)!+J
"))JR8f9ZC#"MEfeYC@jdFb"dEcSJDQeeEQYVD8"cB@jdFQ%ZD(9d,QCT2!!!!3#
3!`TL!!!*BJ#3!k-!$qL3!!,b!*!$(!#5!!0cGf0T!*!$)N&-8P3!N!-Z4%P86!#
3!cTLEfjR!!-!4JI4!!!J!*!%%&8X"p%!"3!!"ai!%&6`"p%!#`!!"qS!%&8)"p6
rr`!!"bi!%&8`"p(rr`!!"ei!%&8d"p2rr`!!"i`!%&8i"p,rr`!!"l`!%&8m"%*
[EQF&3QpZCfm&3QpZCfmGLJ:

hsd@uvacs.cs.Virginia.EDU (Harry S. Delugach) (01/14/89)

Forgive me if this has already been discussed here. I have gotten 
from sumex a copy of "new sounds" which contains several 'snd ' resources.
Unfortunately, they don't work. ResEdit won't play them, and neither will
HyperCard. Can someone suggest what magic must be done to make them work?
I'd appreciate some help.

-- 
                              Harry S. Delugach   
Dept. of Computer Science, Univ. of Virginia, Charlottesville, VA 22901  U.S.A.
        INTERNET: hsd@cs.virginia.edu       BITNET: hsd2x@virginia
        UUCP: ..!uunet!virginia!uvacs!hsd   CIS: 72727,2363

stuartb@microsoft.UUCP (Stuart Burden) (01/14/89)

In article <2917@uvacs.cs.Virginia.EDU> hsd@uvacs.cs.Virginia.EDU
(Harry S. Delugach) writes:
     | Forgive me if this has already been discussed here. I have
     | gotten from sumex a copy of "new sounds" which contains
     | several 'snd ' resources. Unfortunately, they don't work.
     | ResEdit won't play them, and neither will HyperCard. Can
     | someone suggest what magic must be done to make them work?
     | I'd appreciate some help.

ResEdit has never been able to play sounds, at least in my experience (or
is this some dim dark secret that Apple have hidden?).

There are two types of "snd" resources.  Those that Hypercard will play,
and those that the System will play.  It sounds like you have the type
that the system will play.

Seeing you already have res-edit (standard disclaimers about using
res-edit only on a backup copy of your system etc etc), copy the resources
into your system file and try playing them with the control panel sound
cdev.

Hope this helps.

Stu.

__Paths to my door:_______________________
microsoft!stuartb@beaver.cs.washington.edu  -   Usual disclaimer, that all
microsoft!stuartb@uw-beaver.arpa            -   the above is pure fantasy
microsoft!stuartb@uunet.UU.NET              -       and Microsoft only
[DE01HB]stuartb@DASNET#   {from AppleLink}  -    gave me the Mountain Dew
stuartb@microsoft.uucp    {well connected}  -      to dream it all in a
D2012 {@applelink.apple.com - shared acct}  -        caffeine haze :-)
__________________________________________________________________________

leonardr@uxe.cso.uiuc.edu (01/16/89)

stuartb@microsoft.UUCP(Stuart B*) writes in comp.sys.mac
>In article <2917@uvacs.cs.Virginia.EDU> hsd@uvacs.cs.Virginia.EDU
>(Harry S. Delugach) writes:
>     | Forgive me if this has already been discussed here. I have
>     | gotten from sumex a copy of "new sounds" which contains
>     | several 'snd ' resources. Unfortunately, they don't work.
>     | ResEdit won't play them, and neither will HyperCard. Can
>     | someone suggest what magic must be done to make them work?
>     | I'd appreciate some help.
>
>ResEdit has never been able to play sounds, at least in my experience (or
>is this some dim dark secret that Apple have hidden?).
>
	ResEdit version 1.2b3 (which is what I am currently using) is able to
play snd resources.  When you have a file's snds open, then a new menu apprears
called which allows you to play the sound.  I believe that this 'feature'
appeard with this ResEdit 1.2b1 (or there about..)


+---------------------------------+-----------------------------------+
+                                 +  Any thing I say may be taken as  +
+   Leonard Rosenthol             +  fact, then again you might decide+
+   President, LazerWare, inc.    +  that it really isn't, so you     +
+                                 +  never know, do you??             +
+   leonardr@uxe.cso.uiuc.edu     +                                   +
+   GEnie:  MACgician             +  MacNET: MACgician                +
+   Delphi: MACgician             +  AppleLink: D0025                 +
+                                 +                                   +
+---------------------------------+-----------------------------------+

clubmac@runx.ips.oz (Macintosh Users Group) (01/20/89)

In article <269@microsoft.UUCP> stuartb@microsoft.UUCP (Stuart Burden) writes:
>ResEdit has never been able to play sounds, at least in my experience (or
>is this some dim dark secret that Apple have hidden?).

ResEdit 1.2b2 certainly plays 'snd ' resources. Simply open the 'snd ' 'folder'
in a sound resource file, select a resource and select the play menu.


Jason Haines - President, Club Mac
Australia's largest Macintosh Users Group, with over 1500 members.

Phone Home:  011-61-2-73-1016
OZ Post:     Box 213, Holme Building, Sydney University, NSW, 2006, Australia
Internet:    clubmac@runx.ips.oz.au    UUCP: uunet!runx.ips.oz.au!clubmac