iOS: I need to convert CMSampleBuffer Linear PCM audio to MPEG-4 AAC

Hello,

I am a deaf-blind wheelchair user, and I program in Swift using a braille display.

I’m reaching out for your help on an issue I’ve been struggling to solve.

Basically, when I extract a CMSampleBuffer from an AVAsset of a video, it comes with the Audio Format ID as Linear PCM. However, when I try to pass this CMSampleBuffer to write another video using AVAssetWriter, the video ends up muted.

The audio settings of the output video are configured to MPEG-4 AAC, but the input CMSampleBuffer has the Audio Format ID as Linear PCM.

I would like to request an extension for CMSampleBuffer that converts Linear PCM audio to MPEG-4 AAC.

I’ve searched extensively and couldn’t find anything.

Looking forward to your help.

Thank you.

Hello @Paulo_DEV01, thank you for your post. You don't need to convert PCM to AAC before adding a sample buffer to AVAssetWriterInput. Please see this thread.

However, when I try to pass this CMSampleBuffer to write another video using AVAssetWriter, the video ends up muted.

This is likely a separate issue. Can you provide more context?

iOS: I need to convert CMSampleBuffer Linear PCM audio to MPEG-4 AAC
 
 
Q