AudioDeviceSetProperty(.., kAudioDevicePropertyBufferSize, ..) fails with buffer > 27KB
AudioDeviceSetProperty(.., kAudioDevicePropertyBufferSize, ..) fails with buffer > 27KB
- Subject: AudioDeviceSetProperty(.., kAudioDevicePropertyBufferSize, ..) fails with buffer > 27KB
- From: noah williamsson <email@hidden>
- Date: Tue, 28 Jul 2009 22:48:12 +0200
Hi,
Since Mac OS X 10.5.7 I'm unable to set the buffer size to 32KB with
AudioDeviceSetProperty(.., kAudioDevicePropertyBufferSize, ..).
The call fails and returns 1852797029.
The largest buffer size (in increments of 1024) I've found working is 27KB(!).
This makes me believe I've screwed something up when I'm initializing
CoreAudio as I've seen others use 32KB for the size of the audio
buffer.
I'm quite new to CoreAudio and would love to hear an explanation of
what I'm doing wrong.
Below is the code that worked up until Mac OS X 10.5.7.
static AudioDeviceID adev_id;
static AudioDeviceIOProcID adev_pid;
int coreaudio_init_device(void *unused) {
OSStatus s;
UInt32 sz;
int value;
sz = sizeof(adev_id);
s = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice,
&sz, &adev_id);
if(s != 0 || adev_id == kAudioDeviceUnknown)
return -1;
value = 32*1024;
sz = sizeof(value);
s = AudioDeviceSetProperty(adev_id, 0, 0, false,
kAudioDevicePropertyBufferSize, sz, &value);
if(s != 0) {
printf("AudioDeviceSetProperty(kAudioDevicePropertyBufferSize=%d)
failed with error %d\n", value, s);
return -1;
}
return 0;
}
--
Best regards,
Noah Williamsson
_______________________________________________
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