10.7.3 broke (fixed?) my code
10.7.3 broke (fixed?) my code
- Subject: 10.7.3 broke (fixed?) my code
- From: Seth Willits <email@hidden>
- Date: Tue, 13 Mar 2012 16:39:52 -0700
I'm using code almost identical to the Apple sample "RecordAudioToFile".
Here's my code.
https://gist.github.com/805b07756be5a9952388
All it does is record a given AudioDeviceID to an m4a file using Stereo 44.1 kHZ AAC. It worked perfectly fine with the devices I have (internal mics, web cams, etc) on 10.6 and up to 10.7.2, but I just today discovered it's broken on 10.7.3 when recording *some* devices.
I have a Logitech webcam which is 16 kHZ. When recording that, the playback of the file sounds much deeper — I don't have a way to quantify it. I did find that if I tweaked the code to change the output file format to 16 kHZ, it sounds fine. Or, if I change the output stream format of the AUHAL output device to be 44.1 kHZ, that works as well.
What I recognize now is that in the code is it is, there was a mismatch. It previous set the output sample rate of the HALOutput device to be the same rate as the input device itself (See line 239), but the code also dictates the file be 44.1 kHZ (See line 9). So if the mic is 16 kHZ, that simply doesn't line up. But what's weird is that this *totally works fine* on 10.7.2.
So I'm a little lost:
1) What caused the actual break?
2) What's the correct fix? Do I tweak the file format to use the same rate as the device, or the output format of the HAL device to be that of the file? I'm guessing I want the latter.
3) Do I need to change anything else?
Thanks,
--
Seth Willits
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden