Re: Sound Manager Crashing
Re: Sound Manager Crashing
- Subject: Re: Sound Manager Crashing
- From: Laurent de Segur <email@hidden>
- Date: Thu, 21 Feb 2002 09:45:25 -0800
Mark,
You need to do two things in the code for it to work properly :
1) You need to init your sound channel to something. NULL will delegate
that task to the sound manager.
2) You also need to pass a pointer to the volume command in the param2
to get something out of the call.
Here is the code that doesn't crash anymore;
{
SndCommand cmd1;
SndChannelPtr chan1 = NULL;
long volume;
err = SndNewChannel(&chan1, sampledSynth, initStereo, NULL);
cmd1.cmd = getVolumeCmd;
cmd1.param1 = 0;
cmd1.param2 = &volume;
SndDoImmediate(chan1, &cmd1);
}
Hope this helps,
LdS
On Wednesday, February 20, 2002, at 05:46 AM, Mark Thomas wrote:
Hi Guys,
Does any one know why the sound manager crashes, if you create a
sound
channel and then request the volume of the channel straight after code
looks
like this: -
SndChannelPtr mSndChannel;
SndCommand sndCmd={getVolumeCmd,0, 0};
err = SndNewChannel ( &mSndChannel, sampledSynth, initStereo, NULL );
SndDoImmediate (mSndChannel,&sndCmd);
It crashes 3 levels deep in SndDoImmediate. I have a test application
,which
demos this as well, if anyone wants it.
This works fine in MacOS 9.x.
Any Ideas, Possible bug maybe ????
Thanks
Mark.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.