问题
I want to play .opus file using AVAudioPlayer, since AVAudioPlayer doesn't support .opus file, I am trying to find a way to convert .opus to any other audio format so that I can play using AVAudioPlayer. Could anyone help me on this?
Thank you
回答1:
You could use libopus
or libopusfile
C libraries to dynamically decode Opus files to raw PCM audio and feed that to a memory buffer that AVAudioPlayer could decode. You would most likely need to prepend the memory buffer with AIFF/WAV/RIFF header bytes that describe the PCM data.
回答2:
You could use the VLCKit library ;)
https://code.videolan.org/videolan/VLCKit/blob/master/README.md
来源:https://stackoverflow.com/questions/52738113/how-to-convert-opus-file-to-mp3-m4a-aac-in-ios-swift