• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Question regarding audiounits and channel counts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question regarding audiounits and channel counts


  • Subject: Question regarding audiounits and channel counts
  • From: Wayne Pickering <email@hidden>
  • Date: Tue, 15 Apr 2014 14:07:08 -0700

Starting with the simple TremoloUnit I am trying to modify the plug-in to support the exact channel count requirements for our DSP algorithms. It is entirely unclear how to do this.

I have taken the following steps:

1. From the TremoloUnit class, I removed the virtual NewKernel() method
2. I added the ProcessBufferLists override
3. In TremoloUnit::GetPropertyInfo I added the following code

ComponentResult TremoloUnit::GetPropertyInfo (
AudioUnitPropertyID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
UInt32 &outDataSize,
Boolean &outWritable)

    if (inScope == kAudioUnitScope_Global)
    {
        switch (inID)
        {
            case kAudioUnitProperty_SupportedNumChannels:
                printf("TremoloUnit::GetPropertyInfo kAudioUnitProperty_SupportedNumChannels");
                outWritable = false;
outDataSize = sizeof (AUChannelInfo);
return noErr;
        }
    }
    return AUEffectBase::GetPropertyInfo (inID, inScope, inElement, outDataSize, outWritable);
}

4. In TremoloUnit::GetProperty I added the following code:

ComponentResult
TremoloUnit::GetProperty(AudioUnitPropertyID inID,
                         AudioUnitScope  inScope,
                         AudioUnitElement  inElement,
                         void *outData)
{
    if (inScope == kAudioUnitScope_Global)
    {
switch (inID)
        {
            case kAudioUnitProperty_SupportedNumChannels:
            {
                AUChannelInfo channelInfo = {1, 2}; // mono in, stereo out
                *((AUChannelInfo *)outData) = channelInfo;
                printf("TremoloUnit::GetProperty kAudioUnitProperty_SupportedNumChannels returned {1,2}");
               break;
            }
        }
    }
    return AUEffectBase::GetProperty (inID, inScope, inElement, outData);
}

5. I also added the SupportedNumChannels override, as follows:

 UInt32
 TremoloUnit::SupportedNumChannels(const AUChannelInfo** outInfo)
{
    printf("TremoloUnit::SupportedNumChannels returned {1,2}");
    static const AUChannelInfo sChannels[1] = { {1, 2} };
    if (outInfo) *outInfo = sChannels;
    return sizeof (sChannels) / sizeof (AUChannelInfo);
}

When I run AULab, the plug-in appears as a mono plug-in and as a stereo plug-in. It does not appear in the mono->stereo plugin popups.

If I instantiate the plugin as mono I get the following error

4/15/14 1:59:02.321 PM AU Lab[1539]: Error adding insert effect 1->1 to track: -10868

The same goes if I instantiate the plug-in as stereo

4/15/14 1:59:30.601 PM AU Lab[1539]: Error adding insert effect 2->2 to track: -10868

Looking in the console, none of my printf have been hit, leading me to believe there is something I am fundamentally missing about how a plug-in should report its channel count.

Ideas?

 _______________________________________________
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

References: 
 >How to monitor the system > BigTop was a great tool but it is now discontinued (From: Cyril Blanc <email@hidden>)

  • Prev by Date: Re: MIDIPacketList and MIDIClientDispose questions
  • Next by Date: Can a music effect plug-in also be a generator?
  • Previous by thread: How to monitor the system > BigTop was a great tool but it is now discontinued
  • Next by thread: MIDIPacketList and MIDIClientDispose questions
  • Index(es):
    • Date
    • Thread