Converting audio to CAF format for playback on iPhone using OpenAL

IphoneCore AudioOpenalAfconvert

Iphone Problem Overview


I am using the SoundEngine sample code from Apple in the CrashLanding sample to play back multiple audio files. Using the sample caf files included with CrashLanding everything works fine but when I try and use my own samplesconverted to CAF using afconvert all I get is a stony silence ;)

Does anyone have settings for afconvert that will produce a CAF file capable of being played back through OpenAL?

Iphone Solutions


Solution 1 - Iphone

afconvert -f caff -d LEI16@44100 -c 1 in.wav out.caf

References:

Solution 2 - Iphone

Simple bash script to convert the mp3 files in a folder to caf for iphone

#!/bin/bash
for f in *.mp3; do
  echo "Processing $f file..."
  afconvert -f caff -d LEI16@44100 -c 1 "$f" "${f/mp3/caf}"
done

Solution 3 - Iphone

this is the best for size:

> afconvert -f caff -d ima4 original.wav

Solution 4 - Iphone

thanks for the info.

also, if you're looking into additional compression with openAL, this might be of interest:

"iPhone, OpenAL, and IMA4/ADPCM" http://www.wooji-juice.com/blog/iphone-openal-ima4-adpcm.html

Solution 5 - Iphone

It looks like the -c is not working today, I got it with following: > afconvert -f caff -d LEI16 input.m4a output.caf

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDave VerwerView Question on Stackoverflow
Solution 1 - IphoneDave VerwerView Answer on Stackoverflow
Solution 2 - IphonetomwilsonView Answer on Stackoverflow
Solution 3 - IphonescurioniView Answer on Stackoverflow
Solution 4 - IphoneSteph ThirionView Answer on Stackoverflow
Solution 5 - Iphoneuser1528293View Answer on Stackoverflow