Created
August 1, 2017 04:23
-
-
Save 7gano/f9f33b576808bd8620d5b38589a9f192 to your computer and use it in GitHub Desktop.
AVAssetReaderAudioMixOutput
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let asset = AVAsset(url: sourceFileURL) | |
let dict = [AVSampleRateKey:44100, AVFormatIDKey:kAudioFormatLinearPCM] as [String : Any] | |
assetReaderOutput = AVAssetReaderAudioMixOutput(audioTracks: asset.tracks, audioSettings: dict) | |
do { | |
assetReader = try AVAssetReader(asset: asset) | |
if assetReader.canAdd(assetReaderOutput) { | |
assetReader.add(assetReaderOutput) | |
assetReader.startReading() | |
} | |
} catch { | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment