iOS Developer Library

Developer

AVFoundation Framework Reference AVAssetReaderAudioMixOutput Class Reference

Options
Deployment Target:

On This Page
Language:

AVAssetReaderAudioMixOutput

Inherits From


Conforms To


Import Statement


Swift

import AVFoundation

Objective-C

@import AVFoundation;

Availability


Available in iOS 4.1 and later

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.

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

    Declaration

    Swift

    init!(audioTracks audioTracks: [AnyObject]!, audioSettings audioSettings: [NSObject : AnyObject]!)

    Objective-C

    - (instancetype)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.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.1 and later

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

    Declaration

    Objective-C

    + (instancetype)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.

    Import Statement

    Objective-C

    @import AVFoundation;

    Availability

    Available in iOS 4.1 and later

  • audioMix audioMix Property

    The output’s audio mix.

    Declaration

    Swift

    @NSCopying var audioMix: AVAudioMix!

    Objective-C

    @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.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.1 and later

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

    Declaration

    Swift

    var audioSettings: [NSObject : AnyObject]! { get }

    Objective-C

    @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.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.1 and later

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

    Declaration

    Swift

    var audioTracks: [AnyObject]! { get }

    Objective-C

    @property(nonatomic, readonly) NSArray *audioTracks

    Discussion

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

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.1 and later

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

    Declaration

    Swift

    var audioTimePitchAlgorithm: String!

    Objective-C

    @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.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 7.0 and later