best performing mixer solution
best performing mixer solution
- Subject: best performing mixer solution
- From: John Morris <email@hidden>
- Date: Mon, 9 Oct 2006 16:47:17 -0700
I am trying to set up some simple audio playing. My needs are very
simple, play multiple channels of sound (of various sample rates) and
be able to adjust their volumes on the fly. I have an AUGraph with a
default output (kAudioUnitSubType_DefaultOutput) and a stereo mixer
(kAudioUnitSubType_StereoMixer) on top of that. I then just render
the sounds directly into the various elements of the mixer and
control it's volume there (in the mixer).
I already have a system that performs well except for one gotcha.
Everything is fine when I play 44.1kHz samples, but when I go to
22kHz, it is playing too fast (like the rate is still 44.1kHz).
When I go to play a sound, I check the rate of the mixer element, and
if it is different from the sound I want to play, I use
AudioUnitSetProperty(...kAudioUnitProperty_SampleRate,
kAudioUnitScope_Input...) on the proper mixer element. I can check
it afterward, and it is set correctly, but it doesn't seem to have
any effect.
As a test, I switched the mixer to kAudioUnitSubType_3DMixer, and it
is properly handling the 22kHz samples. No other source changes
except for specifying the 3d mixer instead of the stereo one. So, I
would guess that my code is at least mostly working.
So, after all that setup, here comes my question(s).
Am I doing something wrong (or not doing something right) on changing
the sample rate of the stereo mixer?
Do I need to put an kAudioUnitSubType_AUConverter on top of each
stereo mixer element and use that to convert/interpolate the sample
rate? How much of a performance impact would this potentially be?
Should I just use the kAudioUnitSubType_3DMixer? I would assume that
the performance of the 3D mixer would be a lot lower than the stereo
one due to all of the sound localization goodies (that I would never
use). Or would it "do the right thing" and make an optimal path
based on settings that never change?
BTW, I am currently using 10.4.8 (everything up to date) on a MacBook
Pro.
Thanks for any help on this,
John Morris
_______________________________________________
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