[comp.sys.mac.programmer] reading snd format 2 resources

cnc@hpcilzb.HP.COM (Chris Christensen) (05/10/88)

I have been trying to decipher some of the information in Inside
Macintosh volume 5 on the new sound manager. In particular, I want
to let my programs play snd (format 2) resources that are available
in Hypercard Stacks.

As I understand it, these resource can only be played with the
digitized sound synthesizer (resource 'snth' 5) and usually will
contain no notes.

So I open the synthesizer, send the 'snd' as a sound command and then
a series of note commands.

One problem I am having is that the sound command says that you need
to pass a pointer to a sound.

	To the snd resource?
	To the sound header in the snd resource?
	To the sound data in the snd resource?

Do I need to massage the data in the snd itself?

I would appreciate any help and or code samples that do this. Code in LSC
would be a real treat.

Chris Christensen
because of Hypercard

darin@Apple.COM (Darin Adler) (05/13/88)

In article <730025@hpcilzb.HP.COM> cnc@hpcilzb.HP.COM (Chris Christensen) writes:
> I have been trying to decipher some of the information in Inside
> Macintosh volume 5 on the new sound manager. In particular, I want
> to let my programs play snd (format 2) resources that are available
> in Hypercard Stacks.

To play an 'snd ' resource you can use something like the following:

	Handle	soundHandle;
	short	soundID;

	soundHandle = GetResource('snd ', soundID);
	SndPlay(NULL, sound, false);
-- 
Darin Adler						AppleLink:Adler4
UUCP: {sun,voder,nsc,mtxinu,dual}!apple!darin	  CSNET: darin@Apple.com