Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7832657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:20:16+00:00 2026-06-02T12:20:16+00:00

Possible Duplicate: playing a .caf file: works fine in simulator but not in iPhone

  • 0

Possible Duplicate:
playing a .caf file: works fine in simulator but not in iPhone

I’m trying to use SimpleAudioEngine to play background music in an iPhone app I’m working on. I play the background music using the following code:

[[SimpleAudioEngine sharedEngine] preloadBackgroundMusic: @"MenuTheme.mp3"];
[[SimpleAudioEngine sharedEngine] playBackgroundMusic: @"MenuTheme.mp3" loop: YES];

This works fine.

However, when I convert MenuTheme.mp3 to MenuTheme.caf using terminal with the following line:

afconvert -f caff -d LEI16 "MenuTheme.mp3" "MenuTheme.caf"

and I use SimpleAudioEngine again to play the .caf file, it doesn’t work.

Any ideas on how to troubleshoot this? The .caf file does play when I click it. In terminal, when I write:

afinfo "MenuTheme.caf"

It tells me the data format is 2 ch, 44100 Hz, ‘lpcm’ (0x0000000C) 16-bit little-endian signed integer no channel layout.

I really don’t know what’s wrong, but I’m also very new to using audio on the iPhone. Any help is appreciated. Thanks.

edit: afconvert misspelled

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T12:20:19+00:00Added an answer on June 2, 2026 at 12:20 pm

    I think it is afconvert not fconvert as metioned in your question. (I believe that was a typo, right?) I don’t see obvious problem on your command line. I usually use:

    afconvert -f caff -d LEI16@22050 sound.wav
    

    to convert my wave files to CAF.

    Since you cannot play the CAF files by clicking it, I suggest to have a try to convert it to other formats like wave or AIFF:

    afconvert -f AIFC -d ima4 sound.wav
    

    and try to play them in Finder. If it doesn’t work either, try to convert the MPEG Layer 3 file to wave first by some third-party tools such as Audacity and try again with afconvert.

    P.S. I usually use CAF for sound effects, and use AIFF for background music. Please refer to: Sound on iOS: Best Practices.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: On iPhone: Find out what song is currently playing? (in the iPod
Possible Duplicate: Templates: template function not playing well with class’s template member function template
Possible Duplicate: Iphone sdk support for playing mp3 files over the network I need
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: Playing .mp3 and .wav in Java? Friends, please tell me link if
Possible Duplicate: iOS - Detecting whether or not device support phone calls? I'm writing
Possible Duplicate: Advantages of std::for_each over for loop So I was playing around with
Possible Duplicate: Convert to absolute value in Objective-C As i am playing with 2d
Possible Duplicate: Is JavaScript's Math broken? I have just started playing around with Javascript
Possible Duplicate: Android: How to stop media (mp3) in playing when specific milliseconds come?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.