I would like to be able to extract audio from a video file and load it into a buffer played by OpenAL, but I don't know where to begin.
AVFoundation seems the easiest way to do it (compared to FFMPEG, isn't it ?) but I can't find the way to get a buffer playable with OpenAL. I'm using ObjectAL on MacOSX that works very well.
I'm looking for advices, code examples or tutorials about it.
For people who can be interested, here is how I did it. It takes all the formats AVFoundation takes in input.
Here is the code to build the PCM (you'll notice that I'm building 2 buffers, as I needed the audio file reversed).
And the WAV header, if you need it:
Hope it can be useful for someone.