Converting audio to CAF format for playback on iPhone using OpenAL

前端 未结 5 702
无人共我
无人共我 2020-12-07 06:37

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 everyth

相关标签:
5条回答
  • 2020-12-07 07:10

    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
    
    0 讨论(0)
  • 2020-12-07 07:20
    afconvert -f caff -d LEI16@44100 -c 1 in.wav out.caf
    

    References:

    • Apple's Multimedia Programming Guide: Using Audio: Preferred Audio Formats in iOS
    • afconvert(1) man page (use afconvert -h for complete info)
    0 讨论(0)
  • 2020-12-07 07:22

    this is the best for size:

    afconvert -f caff -d ima4 original.wav

    0 讨论(0)
  • 2020-12-07 07:22

    It looks like the -c is not working today, I got it with following:

    afconvert -f caff -d LEI16 input.m4a output.caf

    0 讨论(0)
  • 2020-12-07 07:36

    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

    0 讨论(0)
提交回复
热议问题