• 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: Reduce Audio Time Latency
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reduce Audio Time Latency


  • Subject: Re: Reduce Audio Time Latency
  • From: William Stewart <email@hidden>
  • Date: Mon, 28 Sep 2009 11:01:20 -0700


On Sep 24, 2009, at 11:39 PM, Ravneet Kaur wrote:

Hi

I am working on CoreAudio API to play an audio file(.wav) and change the frequency and volume of the sound file based on the value specified by the user.

I am using the following two API:

AudioUnitSetParameter(*theUnit, kAudioUnitParameterUnit_Hertz, kAudioUnitScope_Output, 0, (Float32)100, 0);
AudioUnitSetParameter(*theUnit, kAudioUnitParameterUnit_LinearGain, kAudioUnitScope_Output, 0, (Float32)90, 0);

Your code is wrong here.

When you call AudioUnitSetParameter, you need to provide the parameter ID (not a parameter unit type). You also have to set the parameter value in the range of the paramter itself.

So, you don't describe which audio unit you are trying to operate on. However, you can see the valid parameter range, etc, of *any* audio unit by using auval. For example, for the output unit (AUHAL - same is true for the default otuptut unit):

auval -v auou ahal appl
...
# # # 1 Global Scope Parameters:
Parameter ID:14
Name: Volume
Parameter Type: Linear Gain
Values: Minimum = 0.000000, Default = 1.000000, Maximum = 1.000000
Flags: Readable, Writable
  -parameter PASS

...

If you then look in <AudioUnit/AudioUnitParameters.h>, you will see this:
enum {
// Global, LinearGain, 0->1, 1
kHALOutputParam_Volume = 14
};


The "14" here is the parameter ID for the volume parameter on AUHAL. That parameter is expressed in a linear scale, where 0 is silence, and 1 is unity gain (its a mulitply)

The parameter information for ANY audio unit can be retrieved using public API - see ParameterInfo, etc, in <AudioUnit/ AudioUnitProperties.h>

Bill

_______________________________________________
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: 
 >Re: Reduce Audio Time Latency (From: Ravneet Kaur <email@hidden>)

  • Prev by Date: Re: auval FATAL ERROR. How to know whee is the component?
  • Next by Date: Re: Question about mono/stereo handling in AUs
  • Previous by thread: Re: Reduce Audio Time Latency
  • Next by thread: Question about mono/stereo handling in AUs
  • Index(es):
    • Date
    • Thread