Skip to content

Instantly share code, notes, and snippets.

@50percentgrey
Last active February 5, 2019 23:35
Show Gist options
  • Save 50percentgrey/5611ef790a7af749e2178182a80b8cf4 to your computer and use it in GitHub Desktop.
Save 50percentgrey/5611ef790a7af749e2178182a80b8cf4 to your computer and use it in GitHub Desktop.
Audio Mac
// convert audio on mac for iOS
// afconvert -d [out data format] -f [out file format] [in file] [out file]
afconvert -d aac -f 'caff' -b 128000 background-music-lei.caf test_128.caf
afconvert -d aac -f 'caff' -b 32000 background-music-lei.caf test_32.caf
afconvert -d aac -f 'caff' background-music-lei.caf test_32.caf
// best formats
If space is not an issue, just encode everything with linear PCM. Not only is this the fastest way for your audio to play, but you can play multiple sounds simultaneously without running into any CPU resource issues.
If space is an issue, most likely you’ll want to use AAC encoding for your background music and IMA4 encoding for your sound effects.
16-bit big-endian signed integer
resource: https://www.raywenderlich.com/2434-audio-tutorial-for-ios-file-and-data-formats-2014-edition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment