CompuServe Thread

#Sound Manager 8KHz

4 messages in this thread
#7023From: Burt JohnsonJul 15, 1993 3:00 AM
I have an application where I need to record sound from the Mic at 8KHz. It is important to use that frequency because I then feed the resulting sound into some hardware that only works at that frequency (telephone stuff). I have the following snippet of code (all error checking removed for brevity): iErr = SPBOpenDevice ("\p", siWritePermission, &recFRef); myLevel.OnOff = 1; myLevel.Level = 0; iErr = SPBSetDeviceInfo (recFRef,siTwosComplementOnOff, (Ptr) &myLevel); fixRate = Long2Fix (8192); iErr = SPBSetDeviceInfo (recFRef,siSampleRate, (Ptr) &fixRate); That last line returns an error stating that I have specified an invalid rate. I also tried just forcing fixRate to the hex value shown in IM6 for 7KHz (an example they use on page 22-45) and get the same error. As such, I am not really sure if the Sound Manager won't record off the mic at that frequency or if I'm passing this command incorrectly somehow. Does anyone here have experience with doing this and can see what is wrong? – Burt
#7068From: Rick Genter, Useful SoftJul 16, 1993 10:03 AM
The sound input devices on the newer (IIsi and after) Macs only record at 11KHz and 22KHz. Try recording at 22KHz and subsampling 1-for-3 to get a little more than 7KHz. Rick Genter Useful Software Corporation
#7081From: Burt JohnsonJul 16, 1993 7:46 PM
>> The sound input devices on the newer (IIsi and after) Macs only record at 11KHz and 22KHz. Major bummer! >> Try recording at 22KHz and subsampling 1-for-3 to get a little more than 7KHz. I tried that quickly last night, and it sounded like Donald Duck. 🙂 I'm going to look at it a bit more, since I may have made a mistake in my coding, but it looks like I may have to switch to the 840AV DSP to do direct recording for this beast… 🙁 – Burt
#7143From: Rick Genter, Useful SoftJul 19, 1993 5:40 AM
To get it to not sound like donald duck, you have to interpolate it back to 22khz by computing the other two points. I have done this and it doesn't sound bad, though it will start to sound like "Mr. Robotto" after you subsample beyond about 6 to 1. Rick Genter Useful Software Corporation