Convert audio (MP3 to PCM) in Swift

I am working on moving a streaming audio player to fast. I need to convert MP3 audio files to PCM buffer before playing with AVAudioEngine. I noticed that in Swift there is no MP3 to PCM ( AudioConverterFillComplexBuffer ) conversion function .

How to quickly write code to convert audio?

+4
source share
1 answer

Hmmm. If I'm not mistaken, what you are looking for can be found here:

Cannot convert mp3 to PCM using AudioConverterFillComplexBuffer in AudioFileStreamOpen's AudioFileStream_PacketsProc callback

You see this line:

AudioConverterFillComplexBuffer(audioConverterRef, AudioConverter_Callback, &convertInfo, &framesToDecode, &localPcmBufferList, nil)

, , , .

0

Source: https://habr.com/ru/post/1545309/


All Articles