Which audio playback options exist for playing MP3 or AAC files on iOS? - iphone

I figured out AVAudioPlayer can play MP3 or AAC. But it also has a big latency. It seems to be loading the entire file into memory first.
Are there other, more efficient options than AVAudioPlayer?

Yes, there are AVPlayer and MPMoviePlayerController (which, despite its name, can also play audio files). MPMoviePlayerController tends to be a bit easier to use in my opinion.

You can use OpenAL library for that which is very very efficient for the purpose you are talking about
Here is the link
https://github.com/kstenerud/ObjectAL-for-iPhone
Have a look .Its too easy to integrate and implement.
Cheers!!!

The lowest-level and lowest-latency option that you can get on iOS is RemoteIO.
This question has some more relevant information: Playback MP3 using RemoteIO and AudioUnits on iPhone... possible?

Related

Live streaming audio from iPhone

I would like to stream audio from my iPhone to a remote server but I don't really know what is my best bet.
I tried here a code for sending small chunks but I have some some audio gaps between chunks.
So I think about FFmpeg or as suggested here writing my own AAC parser.
Any code sample or advices would be appreciated because I have hard time to get started
Another core audio based Audio Player: https://github.com/douban/DOUAudioStreamer .
Just see the examples to use.
In my opinion, this one is better designed than Matt Gallagher's one.
Another alternative is to use my Audjustable AudioPlayer player here: https://github.com/tumtumtum/audjustable
Some good audio stream player on gitHub:-
mattgallagher/AudioStreamer:-https://github.com/mattgallagher/AudioStreamer
tumtumtum/StreamingKit:-https://github.com/tumtumtum/StreamingKit
you can also sreach on github :-
1)muhku/FreeStreamer
2)nicklockwood/SoundManager
3)AFSoundManager
4)GVMusicPlayerController
for live audio streaming StreamingAudioPlayer is best which is developed by Matt Gallagher and it is easy to use
see this AudioStreame

How to play record the sound programmatically and how to play that recorded audio?

I am developing one application. In that I want to record the sounds and I want to play that recorded sound file. I know the frameworks for doing this. But how to develop programmatically by using that frameworks?
You can refer to this link:
I have implemented this code in one of my apps and it works completely fine.
How do I record audio on iPhone with AVAudioRecorder?
For Playing the sound you have option to use AVAudioRecorder.
Hope this helps.
The best way to do it - and I am talking from painful experience here - is with the RemoteIO audio unit. You can also do it with AudioQueue, but it has a higher latency, and the queue type approach becomes very problematic.
So, I think that they are really different tools for different jobs. Note that you won't play a sound file as such. You will play the contents of a buffer held in memory. As long as the buffer is not too large, this should not be an issue.
So, going with RemoteIO, you will find this blog and tutorial very useful. It includes code samples.
Using RemoteIO audio unit By MICHAEL TYSON

How to play streaming audio file in iphone?

How to play streaming audio file in iphone?
I am trying to make an app which can play audio file from web server with Play Pause and stop functionality....
can any one have any idea about this ?
This is a lot simpler now with the advent of AVFoundation. Look at the AVPlayer class. It works great for streaming audio.
Check Matt Gallagher work:
http://cocoawithlove.com/2008/09/streaming-and-playing-live-mp3-stream.html
If this is more that you're willing to, the easy answer would be HTTP Live Streaming.

Playing Audio on the iPhone

I want to play prerecorded audio for users in an iPhone application. Is the best way to play this audio to use openAL? Is there any other way that might be beneficial for what I want to accomplish?
Thanks!
Joe
For most needs, I've found AVAudioPlayer to be an excellent choice for audio playback.
OpenAL covers most audio cases nicely and it is tied to the Core Audio so playback speed is never lagged. Based on what details you gave, OpenAL will take of your needs

Can iphone mix two sound files or build custom equalizer?

Can iphone mix two sound files or build custom equalizer?
I have studied for weeks about this problem,
and it seems unable to use iphone-sdk to mix two or more sound files or to build custom equalizer.
Is anyone have the experience to do this?
Yes you can. AVAudioPlayer can play multiple sounds and you can control the volume for each. Or you can use Audio Units and have more control over the audio data.
aurioTouch is a good sample app for what you are thinking of.
For simple playback of sound files you can use the AVAudioPlayer class introduced in the 2.2 SDK. It provides playback and volume controls for playing any audio file. As far as I am aware, there are no restrictions on the number of sound files you can play on the iPhone. The only restriction on playing sound files is that you may only play one AAC or MP3 compressed file at a time, the rest of the files must be either uncompressed or in the IMA4 format.
If your needs are more low-level (If you need to do DSP) you might want to look at AudioQueue Services or AudioUnits - two Mac OS X audio processing APIs that are also available on the iPhone.