Converting Sound to caf for use with OpenAL
When creating my first game, Pub Pong, which you can download from here by the way, please do it will mean food for a week, but anyway, I was trying to create a fast and reliable audio system. Wavs, Mp3’s were all trialled in my sound engine, but there always seemed to be a trouble whilst loading them in. They were too big, and also the key point to remember about the apple audio toolbox is that if the file is not in caf, it will convert the audio file to it before use, which can cause a small lag in the time from loading to playing.
The best way to imagine it, is that if you had talking in your game, with lip sync, the converting of the files in run time would cause the lips to be out of sync and look a lot like the film Kung Pow. So it is best to convert before compiling.
What this mini tutorial will do is show you how to convert the files using the terminal, a device that Linux users have surgically attached to themselves. Right lets ride this wave:
- First of all, open up terminal. That should be a case of either opening it from the spotlight bar or clicking on it from within the dock.
- For those who are not familiar with the terminal, we will not be using many commands, just a few.
- You first have to get to the lcoation of the files that you are going to want to change.
- First of all list out all the items that you can currently see in terminal, type ls, then hit return:

- From there, you need to to go to the directory where all your files are, mine are in a folder called Audio, so cd Audio will get me there. If yours are in a folder of a different name, it would be cd insertfoldernamehereyeah.
- Then it gets nice and simple as it is an ease to access the converter.

