• 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
Re: Why don't kAudioUnitSubType_NBandEQ support 48000
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why don't kAudioUnitSubType_NBandEQ support 48000


  • Subject: Re: Why don't kAudioUnitSubType_NBandEQ support 48000
  • From: James McCartney <email@hidden>
  • Date: Wed, 23 Mar 2016 13:58:58 -0700


On Mar 14, 2016, at 4:27 AM, Lucas Goossen <email@hidden> wrote:

If I ever try to set a kAudioUnitSubType_NBandEQ audio unit ASBD to 48000 sampling rate I get kAudioUnitErr_FormatNotSupported. I get around by converting but I am curious, why not support 48000?

works for me.

#include <AudioToolbox/AudioToolbox.h>

int main(int argc, const char * argv[]) {
AudioComponentDescription desc = { 'aufx', 'nbeq', 'appl', 0, 0 };
AudioComponent ac = AudioComponentFindNext(NULL, &desc);
AudioComponentInstance au;
OSStatus err = AudioComponentInstanceNew(ac, &au);
if (err) {
fprintf(stderr, "AudioComponentInstanceNew failed %d\n", (int)err);
exit(1);
}


    UInt32 formatFlags = kAudioFormatFlagIsPacked | kAudioFormatFlagIsFloat | kAudioFormatFlagIsNonInterleaved ;
    AudioStreamBasicDescription asbd = { 48000., 'lpcm', formatFlags, 4, 1, 4, 2, 32, 0 };

    UInt32 propSize = sizeof(asbd);
    err = AudioUnitSetProperty(au, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &asbd, propSize);
    printf("set input format err %d\n", (int)err);
    if (err) return 8;
    err = AudioUnitSetProperty(au, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &asbd, propSize);
    printf("set output format err %d\n", (int)err);
    if (err) return 9;

err = AudioUnitInitialize(au);
    printf("initialize err %d\n", (int)err);
    if (err) return 9;

    return 0;
}

set input format err 0
set output format err 0
initialize err 0
Program ended with exit code: 0



James McCartney
Apple CoreAudio
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

  • Follow-Ups:
    • Re: Why don't kAudioUnitSubType_NBandEQ support 48000
      • From: Lucas Goossen <email@hidden>
References: 
 >Why don't kAudioUnitSubType_NBandEQ support 48000 (From: Lucas Goossen <email@hidden>)

  • Prev by Date: Re: Coreaudio-api Digest, Vol 13, Issue 48
  • Next by Date: Re: Best practice for checking 64-bit AU support?
  • Previous by thread: Why don't kAudioUnitSubType_NBandEQ support 48000
  • Next by thread: Re: Why don't kAudioUnitSubType_NBandEQ support 48000
  • Index(es):
    • Date
    • Thread