AVMutableAudioMixInputParameters Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AVFoundation.framework
Availability
Available in iOS 4.0 and later.
Declared in
AVAudioMix.h
Related sample code

Overview

An AVMutableAudioMixInputParameters object represents the parameters that should be applied to an audio track when it is added to a mix.

Tasks

Creating Input Parameters

Managing the Track ID

Setting the Volume

Getting an Audio Tap

Time Pitch Settings

Properties

audioTapProcessor

The audio processing tap associated with the track.

@property(nonatomic, retain) MTAudioProcessingTapRef audioTapProcessor
Discussion

You can use this property to associate an audio tap with the audio track. You can use the audio tap to access the audio data before it is played, read, or exported.

Availability
  • Available in iOS 6.0 and later.
Declared In
AVAudioMix.h

audioTimePitchAlgorithm

The processing algorithm used to manage audio pitch for scaled audio edits.

@property(nonatomic, copy) NSString *audioTimePitchAlgorithm
Discussion

The supported constants are defined in Time Pitch Algorithm Settings.

An NSInvalidArgumentException will be raised if this property is set to a value other than the defined constants.

Availability
  • Available in iOS 7.0 and later.
Declared In
AVAudioMix.h

trackID

The ID of the audio track to which the parameters should be applied.

@property(nonatomic) CMPersistentTrackID trackID
Availability
  • Available in iOS 4.0 and later.
Declared In
AVAudioMix.h

Class Methods

audioMixInputParameters

Creates and returns a mutable input parameters object with no volume ramps and trackID initialized to kCMPersistentTrackID_Invalid.

+ (AVMutableAudioMixInputParameters *)audioMixInputParameters
Return Value

A mutable input parameters object with no volume ramps and trackID initialized to kCMPersistentTrackID_Invalid.

Availability
  • Available in iOS 4.0 and later.
Declared In
AVAudioMix.h

audioMixInputParametersWithTrack:

Creates and returns a mutable input parameters object for a given track.

+ (AVMutableAudioMixInputParameters *)audioMixInputParametersWithTrack:(AVAssetTrack *)track
Parameters
track

The track to associate with the input parameters object.

Return Value

A mutable input parameters object with no volume ramps and trackID set to track’s ID.

Availability
  • Available in iOS 4.0 and later.
Declared In
AVAudioMix.h

Instance Methods

setVolume:atTime:

Sets the value of the audio volume starting at the specified time.

- (void)setVolume:(float)volume atTime:(CMTime)time
Parameters
volume

The volume. The value must be between 0.0 and 1.0.

time

The start time at which to set the volume.

Discussion

This method adds a volume ramp starting at time. This volume setting remains in effect until the end of the track unless you set a different volume level to start at a later time.

Availability
  • Available in iOS 4.0 and later.
Declared In
AVAudioMix.h

setVolumeRampFromStartVolume:toEndVolume:timeRange:

Sets a volume ramp to apply during a specified time range.

- (void)setVolumeRampFromStartVolume:(float)startVolume toEndVolume:(float)endVolume timeRange:(CMTimeRange)timeRange
Parameters
startVolume

The starting volume. The value must be between 0.0 and 1.0.

endVolume

The end volume. The value must be between 0.0 and 1.0.

timeRange

The time range over which to apply the ramp.

Availability
  • Available in iOS 4.0 and later.
Related Sample Code
Declared In
AVAudioMix.h