• 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: Problems with AUPitch and sample rate (perhaps S/R change problems in general)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with AUPitch and sample rate (perhaps S/R change problems in general)


  • Subject: Re: Problems with AUPitch and sample rate (perhaps S/R change problems in general)
  • From: "B.J. Buchalter" <email@hidden>
  • Date: Sat, 15 Jul 2006 12:53:06 -0400
  • Thread-topic: Problems with AUPitch and sample rate (perhaps S/R change problems in general)

To answer my own question for the archives:

> When I change the sample rate, I do the following:
>
>     err = AudioUnitUninitialize(mInstance);
>     err = AudioUnitSetProperty(mInstance, kAudioUnitProperty_SampleRate,
>         kAudioUnitScope_Global, 0, &caSR, size);
>     err = AudioUnitInitialize(mInstance);

Turns out that this changes the Sample rate only on the 0 element of the
output scope (in the AU SDK, the code says that this is a "convenience"
alias to the output).

IMO, this is a bug in the AU base classes. If I change the SR globally on a
AU, the AU base classes should automatically scan over all valid scopes and
elements and apply the SR change to all of them.

Bill, would you agree with this? Was this just an oversight, or was it done
like this by design? If you folks agree that this is a bug, I will radar it.

In any case, the work-around for this (or perhaps, the proper recipe) is to
manually apply the SR change to all the scopes and elements that are in use:


    err = AudioUnitUninitialize(mInstance);
    err = AudioUnitSetProperty(mInstance, kAudioUnitProperty_SampleRate,
        kAudioUnitScope_Global, 0, &caSR, size);
    err = AudioUnitSetProperty(mInstance, kAudioUnitProperty_SampleRate,
        kAudioUnitScope_Input, 0, &caSR, size);
    err = AudioUnitSetProperty(mInstance, kAudioUnitProperty_SampleRate,
        kAudioUnitScope_Output, 0, &caSR, size);
    err = AudioUnitInitialize(mInstance);


This removes the odd behavior I was seeing from AUPitch.

Best regards,

B.J. Buchalter

Metric Halo
5 Donovan Drive
Hopewell Junction, NY 12533 USA
tel +1 845 223-6112
fax +1 603 250-2451


 _______________________________________________
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: Problems with AUPitch and sample rate (perhaps S/R change problems in general)
      • From: William Stewart <email@hidden>
References: 
 >Problems with AUPitch and sample rate (perhaps S/R change problems in general) (From: "B.J. Buchalter" <email@hidden>)

  • Prev by Date: Problems with AUPitch and sample rate (perhaps S/R change problems in general)
  • Next by Date: Using aggregate devices with iSight
  • Previous by thread: Problems with AUPitch and sample rate (perhaps S/R change problems in general)
  • Next by thread: Re: Problems with AUPitch and sample rate (perhaps S/R change problems in general)
  • Index(es):
    • Date
    • Thread