Playing URL of MP3 from iPhone - iphone

I am trying to find the best way to play a URL of an mp3. I've tried Audiostreamer but it doesn't fit my needs as it's geared towards infinite streams, and not finite streams.
Any help is appreciated!
Thanks!

AVAudioPlayer is your answer:
http://developer.apple.com/iPhone/library/documentation/AVFoundation/Reference/AVAudioPlayerClassReference/Reference/Reference.html#//apple_ref/occ/instm/AVAudioPlayer/initWithContentsOfURL:error:

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

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

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?

How could I stream Audio in iphone after a certain buffering amount occured?

I am using Matt Gallagher's AudioStreamer class for my audio streaming app. I need to make the audio stream without any interruption. Can anyone help me in this? I think there is something to do with the buffering size. As am new to iphone developing please help me out.
Thanks
Well no, you can't force the audio to play uninterrupted, you can increase the buffer size.
Increasing the buffer will help a bit, don't make it to big or it will take a long time to buffer.
But the most important thing is the mobile internet, which isn't the best to stream Audio.
If the connection is dropped then your stream will be interrupted and there is nothing you can really do about it.

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.

Play MP3 audio data on iPhone

I need to play mp3 audio data in iPhone continuously. I am getting continuous mp3 data via server in iPhone. Now I need to play this data in iPhone. I cannot access url to play as it is of mms protocol. So, for playing this type of data which is the best method to use. Can anyone help me out with this thing.
Thanks in advance.
You have a few options sanctioned by or directly from Apple. You should look into:
Core Audio and the Audio Toolbox
The AVFoundation Framework
The OpenAL Framework
Also, you can try Matt Gallagher's AudioStreamer class. It should be able to do the job, or at least help you figure out how to do so, if you look at the code.
Between those four options, there should be something to help.
NOTE:
After writing this, I did a bit of Googling and I found this thread that discusses the possibility of streaming MMS media to iPhone. It appears that it is not possible, due to the cost of a license from Microsoft. In theory, the above-mentioned frameworks should do everything you need, but it seems that you cannot because of the licensing issue.
Good luck!
audioPlayer = [[AVAudioPlayer alloc]initWithData:<#(NSData )data#> error:<#(NSError *)outError#>];
try this else tell me more clear what you want to do