AVAssetReaderAudioMixOutput Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AVFoundation.framework
Availability
Available in iOS 4.1 and later.
Declared in
AVAssetReaderOutput.h

Overview

AVAssetReaderAudioMixOutput is a concrete subclass of AVAssetReaderOutput that defines an interface for reading audio samples that result from mixing the audio from one or more tracks of an AVAssetReader object's asset.

You can read the audio data mixed from one or more asset tracks by adding an instance of AVAssetReaderAudioMixOutput to an asset reader using addOutput:. The samples can be read in a default format or can be converted to a different format.

Tasks

Creating an Audio Mix Output

Settings

Properties

audioMix

The output’s audio mix.

@property(nonatomic, copy) AVAudioMix *audioMix
Discussion

You use the audio mix to specify how the volume of audio samples read from each source track will change over the timeline of the source asset.

Availability
  • Available in iOS 4.1 and later.
Declared In
AVAssetReaderOutput.h

audioSettings

The audio settings used for audio output. (read-only)

@property(nonatomic, readonly) NSDictionary *audioSettings
Discussion

The dictionary must contain values for keys in Linear PCM Format Settings.

Setting the property value to nil indicates that the receiver will return audio samples in a convenient uncompressed format, with sample rate and other properties determined according to the properties of the receiver's audio tracks.

Availability
  • Available in iOS 4.1 and later.
Declared In
AVAssetReaderOutput.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
AVAssetReaderOutput.h

audioTracks

The tracks from which the receiver reads mixed audio. (read-only)

@property(nonatomic, readonly) NSArray *audioTracks
Discussion

The value is an array of AVAssetTrack objects owned by the target AVAssetReader object’s asset.

Availability
  • Available in iOS 4.1 and later.
Declared In
AVAssetReaderOutput.h

Class Methods

assetReaderAudioMixOutputWithAudioTracks:audioSettings:

Returns an instance of AVAssetReaderAudioMixOutput for reading mixed audio from the specified audio tracks, with optional audio settings.

+ (AVAssetReaderAudioMixOutput *)assetReaderAudioMixOutputWithAudioTracks:(NSArray *)audioTracks audioSettings:(NSDictionary *)audioSettings
Parameters
audioTracks

An array of AVAssetTrack objects from which the created object should read sample buffers to be mixed.

Each track must be one of the tracks owned by the target AVAssetReader object’s asset and must be of media type AVMediaTypeAudio.

audioSettings

The audio settings to be used for audio output; the dictionary must contain values for keys in Linear PCM Format Settings.

Pass nil if you want to receive decoded samples in a convenient uncompressed format, with properties determined according to the properties of the specified audio tracks. AVSampleRateConverterAudioQualityKey is not supported.

Return Value

An instance of AVAssetReaderAudioMixOutput for reading mixed audio from audioTracks, with audio settings specified by audioSettings.

Discussion

Initialization will fail if audioSettings cannot be used with audioTracks.

Availability
  • Available in iOS 4.1 and later.
Declared In
AVAssetReaderOutput.h

Instance Methods

initWithAudioTracks:audioSettings:

Initializes an instance of AVAssetReaderAudioMixOutput for reading mixed audio from the specified audio tracks, with optional audio settings.

- (id)initWithAudioTracks:(NSArray *)audioTracks audioSettings:(NSDictionary *)audioSettings
Parameters
audioTracks

An array of AVAssetTrack objects from which the created object should read sample buffers to be mixed.

Each track must be one of the tracks owned by the target AVAssetReader object’s asset and must be of media type AVMediaTypeAudio.

audioSettings

The audio settings to be used for audio output; the dictionary must contain values for keys in Linear PCM Format Settings.

Pass nil if you want to receive decoded samples in a convenient uncompressed format, with properties determined according to the properties of the specified audio tracks. AVSampleRateConverterAudioQualityKey is not supported.

Return Value

An instance of AVAssetReaderAudioMixOutput initialized for reading mixed audio from audioTracks, with audio settings specified by audioSettings.

Discussion

Initialization will fail if audioSettings cannot be used with audioTracks.

Availability
  • Available in iOS 4.1 and later.
Declared In
AVAssetReaderOutput.h