How to download an audio file from internet and play it using AvAudioplayer in Iphone sdk? - objective-c

I need to download an audio file from the net and want to play it Using AVAudioPlayer.can any one give me suggestions how to do this.

you can use the NSURLConnection if you save the file in the server. the following is the link:
http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html#//apple_ref/occ/clm/NSURLConnection/sendSynchronousRequest:returningResponse:error:
This is the method name sendSynchronousRequest:returningResponse:error:
For the playlist, I am not used before, so cannot help you.
Good luck.

Related

Can I read a sound attachment (like .mp3) from Notes document without detaching it?

I tried to use a url (like http://www.example.com/dbname.nsf/notesunid/$File/filename.mp3) to play a sound attachment from Notes document on Domino server 9.0.2. I hope it can play directly by streaming but it always download the file. Any suggestion?
You should be able to use HTML5 Audio for this. Here's a simple example:
<audio src="/dbname.nsf/notesunid/$File/filename.mp3" controls></audio>

Cache Video while loading

I tried to search both on the site and google, but I could not find anything.
I want to save the MPMoviePlayerController cache of a video stream.
I tried with different libraries like ASIHttpRequest and others but I can't play the video until it is finished downloading.
Is possible to save the cache or play while downloading?
Thank you very much in advance.

Using Audio Unit (Mixer Host) to play from iPod library instead of pre selected sound files.

For a university project i'm working on a DJ mixing app. I'm essentially tackling this project from a 'teach yourself from scratch by googling everything and analysing pre existing source code' type of way so go easy.
I have looked at the Mixer Host sample project from apple found here: http://developer.apple.com/library/ios/#samplecode/MixerHost/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010210
I can't work out how to replace the pre selected audio files (guitar + beat) with a song URL from the iPod library selected from a media picker, or, in this case - 2 media pickers.
Is it a case of grabbing the URL of the iPod library song selected and putting in place of the URL of the preselected audio file?
If someone could point me in the right direction, tell me how i'm completely going about this the wrong way, or even do the coding for me (joke), it would be greatly appreciated.
You can't actually simply stream from the ipod library; you need to copy the files into the documents directory of the app.
try this: http://www.subfurther.com/blog/2010/12/13/from-ipod-library-to-pcm-samples-in-far-fewer-steps-than-were-previously-necessary/
You can use third party libraries to play a iPod library songs using AudioUnit. The below link is useful to you
Clickhere!

How to save a .webarchive in UIWebView?

I am following this tutorial and was wondering how I can save the current webpage as a .webarchive with the code I am using from the tutorial?
Help is very much appreciated - thanks!
You can't. Unlike its Mac counterpart WebView, UIWebView has no API for creating web archives. It can display webarchives that have been created on the Mac though (e.g. using Save as... in Safari).

What's the recommended way to programmatically play an audio stream using iPhone SDK?

I have an mp3 on a remote server. Want to play it as a stream, using my own UI,and my own ViewController.
How would you recommend doing that?
I used the code from this page to make a streamer, and it worked well, and was easy to implement.
http://cocoawithlove.com/2009/06/revisiting-old-post-streaming-and.html