I'm using AVMutableComposition
and AVAssetExportSession
to combine a silent MP4 video with a WAV audio file. The basic steps are:
- Create
AVAsset
s for the video and audio - Add tracks to the
AVMutableComposition
- Add each
AVAsset
s first track to a track in theAVMutableComposition
- Create an
AVAssetExportSession
usingAVAssetExportPresetPassthrough
- Export asynchronously
Everything works, but the audio sample rate of the resulting video file is always 44.1 kHz, regardless of the sample rate of the WAV file. Is there a way to set the audio sample rate of the video file that's created?