AVAssetWriter sample rate AV drift

I have an AVAssetWriter and I do set audio compression settings dictionary using canApply(outputSettings: audioCompressionSettings, forMediaType: .audio) API.

One of the fields in the compression settings is setting an audio sample rate using AVSampleRateKey. My question is if the sample rate I set in this key is different from sample rate of audio sample buffers that are appended, can this cause audio to drift away from video? Is setting arbitrary sample rate in asset writer settings not recommended?

Hello, setting a different sample rate will cause the asset writer to do a sample rate conversion. It shouldn't affect the ability of the playback system to keep audio and video in sync when you play back the resulting file.

AVAssetWriter sample rate AV drift
 
 
Q