[comp.sys.mac.programmer] Help with SPBSetDeciveInfo in new Sound Man.!!!!

kinsey@athena.cs.uga.edu (Kevin Kinsey) (04/29/91)

Hey Folks,

I need some help here. I've tried (seemingly) every possible combination of
data types I can come up with at 1:30a.m. and nothing seems to work.

This is the call currently:
sndErr = SPBSetDeviceInfo (myInRefNum, siVoxStopInfo, (Ptr)&astruct.onOff);

where astruct = structure of {int onOff, trigger, delay}.

I have tried substituting various other data types (3 ints, pointers to 
struct, pointer to ints, etc...) and nothing is working.

Upon execution, I get an error -231 = Unknown type of Information.

I'm hoping that I'm doing something dreadfully stupid and anyone's help 
would be useful and appreciated.

BTW, I am using sys 6.0.7 with TC 4.0.2 (with the new headers)

Thanks,

Kevin Kinsey
UCNS
University of Georgia
Athens, GA
kinsey@athena.cs.uga.edu

REEKES@applelink.apple.com (Jim Reekes) (04/30/91)

In article <1991Apr29.043140.10277@athena.cs.uga.edu>, kinsey@athena.cs.uga.edu (Kevin Kinsey) writes:
> 
> Hey Folks,
> 
> I need some help here. I've tried (seemingly) every possible combination of
> data types I can come up with at 1:30a.m. and nothing seems to work.
> 
> This is the call currently:
> sndErr = SPBSetDeviceInfo (myInRefNum, siVoxStopInfo, (Ptr)&astruct.onOff);
> 
> where astruct = structure of {int onOff, trigger, delay}.
> 
> I have tried substituting various other data types (3 ints, pointers to 
> struct, pointer to ints, etc...) and nothing is working.
> 
> Upon execution, I get an error -231 = Unknown type of Information.
> 
> I'm hoping that I'm doing something dreadfully stupid and anyone's help 
> would be useful and appreciated.
> 
> BTW, I am using sys 6.0.7 with TC 4.0.2 (with the new headers)


First problem, VOX is not working in System 6.0.7.  This is why you're
getting errors.  It works under System 7.

Secondly, here how to turn VOX stop on with delay.

void SetVoxStop(short value)
{
 short    VoxData[3];
 OSErr    err;

 if (value > 0)
   VoxData[0] = 1;           // turn it on 
 else
   VoxData[0] = 0;           // turn it off
 VoxData[1] = value;
 VoxData[2] = GetVoxDelayData();
 err = SPBSetDeviceInfo(gSndInputRef, siVoxStopInfo, (Ptr) VoxData);
 if (err)
    AlertUser(err);
}

Jim Reekes, E.O., Mac Toolbox Engineer (working on the Sound Manager)