• 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
Setting rate on AudioUnit subtype kAudioUnitSubType_NewTimePitch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting rate on AudioUnit subtype kAudioUnitSubType_NewTimePitch


  • Subject: Setting rate on AudioUnit subtype kAudioUnitSubType_NewTimePitch
  • From: Vincent Carlier <email@hidden>
  • Date: Sun, 25 Jun 2017 16:15:37 +0200

I'm trying to get/set the rate of an AudioUnit with subtype
`kAudioUnitSubType_NewTimePitch`.

The audio unit is added to an `AUGraph`, through an `AUNode`, which has the
following component description:

    acd->componentType = kAudioUnitType_Effect;
    acd->componentSubType = kAudioUnitSubType_NewTimePitch;
    acd->componentManufacturer = kAudioUnitManufacturer_Apple;

According to `AudioUnitParameters.h`, get/set the rate should be as simple as
get/set the rate parameter on the audio unit.

    // rate control.
        // Global, rate, 1/32 -> 32.0, 1.0
        kNewTimePitchParam_Rate
= 0,

However, while setting the value seems no problem (no error is returned)
getting the value yields a `OSStatus` with value `-10878
(kAudioUnitErr_InvalidParameter)`.

Here is how I set the value :

    - (void)setTempo:(float)value {
        OSStatus err = noErr;
        err = AudioUnitSetParameter(tempoUnit, kNewTimePitchParam_Rate,
kAudioUnitScope_Global, 0, (Float32)value, 0);
        if (err != noErr) {
            NSLog(@"Could not set tempo unit rate: %d", err);
        } // no error
    }

and how I (try to) get it :

    - (float)tempo {
        OSStatus err = noErr;
        Float32 value = 1.0;
        err = AudioUnitGetParameter(tempoUnit, kNewTimePitchParam_Rate,
kAudioUnitScope_Global, 0, &value);
        if (err != noErr) {  // -10878
            NSLog(@"Could not get tempo unit rate: %d", err);
        }
        return value;
    }

The input of the node is connected to a mixer node, and the output to the
RemoteIO unit.

Any 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

  • Prev by Date: Re: Crash in AudioToolbox DLSSample::GetMoreFrames
  • Next by Date: Speech and AVAudioUnitGenerator callback not working properly?
  • Previous by thread: Re: Crash in AudioToolbox DLSSample::GetMoreFrames
  • Next by thread: Speech and AVAudioUnitGenerator callback not working properly?
  • Index(es):
    • Date
    • Thread