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 589711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:27:09+00:00 2026-05-13T15:27:09+00:00

I’m making an iphone game, currently using openAL for SFX, we want to keep

  • 0

I’m making an iphone game, currently using openAL for SFX, we want to keep the game under 10 meg.

iphone (through openAL atleast) only natively plays uncompressed PCM.

What would be the most straightforward way of getting music from some sort of good compressed format (mp3, aac, ogg etc) into my game?

Is there some sort of decoder api? should I be using openAL?

EDIT:

OK, we’ve done some calculations, and we should be able to fit everything in nicely with a simple 64kb/s compression scheme, so I’m looking for the easiest way to decode a compressed file (preferably from memory) to raw pcm in memory for use with open al. we will also need a streaming decoder, it is not necessary for it to be able to decode the stream from memory, but it would be nice. We want to put looping in for the track, so it would be ideal if the decoder had “random access” so you could move around the track easily.

  • 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-05-13T15:27:09+00:00Added an answer on May 13, 2026 at 3:27 pm

    Ok, I’ve just got it all set up.

    I used Audio Queues for the music stream simply because it is the ONE part of the iPhone SDK that is well documented:

    http://developer.apple.com/iphone/library/documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/AboutAudioQueues/AboutAudioQueues.html#//apple_ref/doc/uid/TP40005343-CH5-SW1

    for the general explanation and

    http://developer.apple.com/iphone/library/documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/AQPlayback/PlayingAudio.html#//apple_ref/doc/uid/TP40005343-CH3-SW1

    for a great example (that is a bit buggy)

    this seems to work fine along side openAL. and it does seem that it will allow us to jump randomly about the stream at a sample level of accuracy.

    the only remaining thing to do is get it so we can load from memory, this is done by replacing the:

    AudioFileOpenURL

    Call with a call to:

    AudioFileOpenWithCallbacks

    Unfortunately the documentation for the Audio File Services is… poor… to say the least.

    read it at your own risk, and then after it inexplicably doesn’t work read:
    http://developer.apple.com/iphone/library/qa/qa2009/qa1676.html

    where it tells you that the callbacks are actually optional, and by supplying a write one you are telling it to open the file for writing which it can’t do for MP4s, so just pass NULL for the write and setSize callback.

    I would also like to say that the two answers here recommending MIDI are almost certainly the right way to go if you really want the smallest size.

    Unfortunately we are lazy and just wanted something in quickly, it also came to light that we could fit in moderately compressed audio. I was also slightly worried about the performance implication (I don’t know what that would be for midi) but apparently this method for compressed audio here uses hardware decoding.

    If you want to go the traditional compressed audio route hopefully this helps, you could also try the Audio Converter Services if you want to use the data with openal, unfortunately this API also falls into the embarrassingly poorly documented reference manuals. I don’t even know if it works, and if it does, I’m not sure if it uses the hardware decoders.

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

Sidebar

Related Questions

No related questions found

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.