• 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
NBandEQ Band Limit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NBandEQ Band Limit


  • Subject: NBandEQ Band Limit
  • From: Lucas Goossen <email@hidden>
  • Date: Tue, 02 Apr 2013 11:31:12 -0500

I am able to get it to work great for anything under 16 bands but I want more :) What happens is that if I make it a 15 band EQ everything works but if I go any number 16 and up I get a -10851 (kAudioUnitErr_InvalidPropertyValue) error when I am settingkAUNBandEQProperty_NumberOfBands then the first 8 bands set up fine and the rest result in the -10878 (kAudioUnitErr_InvalidParameter) error. So 15 bands can successfully be done but when I go to 16 all of a sudden only 8 can be done. There is kAUNBandEQProperty_MaxNumberOfBandsthat I can read that I assumed would be the limit that the device in its current state could handle. Well it spits out erratic numbers everything from 12 digit numbers to 4 digit numbers. I think to myself does it not like the extreme frequencies I am giving it. I eliminated that possibility. Then I realized that the bandwidth of the bands may be overlapping and it doesn't like that. so I reduce the bandwidth from the default .5 to the min. .05 no help there ether.

I did realize that after all my messing around with the settings that was all silly because it starts complaining before I even get to those settings. It is already giving and error in the number of bands.

I am posting this question to see if any more experienced programers can see something in my code that is messing me up and point it out to me. I realize that not to many have venture into core audio much less NBandEQ but maybe I am messing up some basic C so please have a look. I will be very thankful. I am frustrated obviously. Also in posting this code (even tho it is ugly test code) maybe I can help others that come behind. I know I wish there was at least one snippet of code out there that I could have had a look at in relation to NBandEQ

Thanks in advance for the help!

    //Getting max bands for this device???
UInt32 maxNumOfBands;
UInt32 propSize = sizeof(maxNumOfBands);
AudioUnitGetProperty([_equilizer audioUnit],
                     kAUNBandEQProperty_MaxNumberOfBands,
                     kAudioUnitScope_Output,
                     0,
                     &maxNumOfBands,
                     &propSize);
NSLog(@"THIS IS THE MAX NUMBER OF BANDS?---%u",(unsigned int)maxNumOfBands);

UInt32 noBands = [eqFrequencies count];
// Set the number of bands first
NSLog(@"NumberOfBands atempted:%i with result:%ld", (unsigned int)noBands, AudioUnitSetProperty(_equilizer.audioUnit,
                     kAUNBandEQProperty_NumberOfBands,
                     kAudioUnitScope_Global,
                     0,
                     &noBands,
                     sizeof(noBands)));
// Set the frequencies
for (NSUInteger i=0; i<noBands; i++) {
   NSLog(@"Set Frequency for band:%i with result:%ld", i, AudioUnitSetParameter([_equilizer audioUnit],
                          kAUNBandEQParam_Frequency+i,
                          kAudioUnitScope_Global,
                          0,
                          (AudioUnitParameterValue)[[eqFrequencies objectAtIndex:i] floatValue],
                          0));
}
// Set the bypass to off "0"
for (NSUInteger i=0; i<noBands; i++) {
    NSLog(@"Set bandwidth for band:%i with result:%ld", i, AudioUnitSetParameter([_equilizer audioUnit],
                          kAUNBandEQParam_Bandwidth+i,
                          kAudioUnitScope_Global,
                          0,
                          0.05,//of octive
                          0));
}

//set bandwidth
for (NSUInteger i=0; i<noBands; i++) {
    NSLog(@"Set Bypass for band:%i with result:%ld", i, AudioUnitSetParameter([_equilizer audioUnit],
                                                   kAUNBandEQParam_BypassBand+i,
                                                   kAudioUnitScope_Global,
                                                   0,
                                                   0,//off
                                                   0));
}

 _______________________________________________
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

  • Prev by Date: Audio server plugin and in buffer size
  • Next by Date: Re: AUSampler bug
  • Previous by thread: Re: AUSampler bug
  • Next by thread: Handling App Interruptions - AudioUnit fails to restart
  • Index(es):
    • Date
    • Thread