Re: Using iPhone's iPodEq Audio Unit
Re: Using iPhone's iPodEq Audio Unit
- Subject: Re: Using iPhone's iPodEq Audio Unit
- From: William Stewart <email@hidden>
- Date: Wed, 6 May 2009 10:43:28 -0700
an audio unit needs to be in the signal chain in order for it to have
an affect. So, just creating an audio unit is not sufficient (all that
does is to create the code, etc, that would do the processing, but it
hasn't connected it into the processing chain).
When you use an audio queue, you don't have direct access to the
processing chain that the audio goes through - you provide buffers of
audio, that audio goes through conversion processes, etc, and then it
is output.
We currently don't provide any API to allow you to apply EQ settings
on an audio queue - it is something we could add, but we don't have it
at this point.
Bill
On May 5, 2009, at 11:26 PM, kode breaker wrote:
Hi All,
I am trying to use the kAudioUnitSubType_AUiPodEQ and I can't
get it to work. I don't see any documentation for its properties
which can be set, so I am testing using values based on an enum,
which I believe might be part of the reason why it doesn't work. I
am using an audio queue to play audio, and would like to have the
option to change the EQ setting for the audio playback. Here is code
I am trying:
-(void) SetupEQUnit:(UInt32)nEqLevel
{
// Open the output unit
int result = 0;
AudioComponentDescription desc;
desc.componentType = kAudioUnitType_Effect; // I've also tried
kAudioUnitType_Output with no success
desc.componentSubType = kAudioUnitSubType_AUiPodEQ;
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
desc.componentFlags = 0;
desc.componentFlagsMask = 0;
result = AudioUnitUninitialize(m_EQUnit); // Incase we were already
loaded...
printf("AudioUnitUninitialize result is %d\n", result);
AudioComponent comp = AudioComponentFindNext(NULL, &desc);
result = AudioComponentInstanceNew(comp, &m_EQUnit);
printf("AudioComponentInstanceNew result is %d\n", result);
result = AudioUnitSetProperty(m_EQUnit, nEqLevel, 0, 0, (const void
*)nEqLevel, sizeof(UInt32));
printf("AudioUnitSetProperty result is %d\n", result);
result = AudioUnitInitialize(m_EQUnit);
printf("AudioUnitInitialize result is %d\n", result);
}
The GDB output is below:
AudioUnitUninitialize result is -50
AudioComponentInstanceNew result is 0
AudioUnitSetProperty result is -10851
AudioUnitInitialize result is 0
While the audio is playing, I'd like to call this function to set
the EQ setting.
Any help with figuring out how to set this will be greatly
appreciated.
Thanks in advance,
KappA
_______________________________________________
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
_______________________________________________
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