This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
downloading mp3 file from server in iphone programing.
How can I play music from the internet in my iPhone program? I want to play the song depending on the rate of download. Please guys, help. I have tried for one week.
I assume you try to open it with Safari? Could you be more specific as to why it doesn't work and what kind of source (file) that is?
Ideally you download it on your Mac or PC and sync it to your iPhone. If that is not possible you could try another browser like Opera. Alternatively there are several streaming apps which play music (free of charge) like last.fm or pandora.
good luck*
Related
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to reverse an audio file?
Is there any way/library in objective-c to make the audio file in reverse order.
Actually in my application user record his voice and then change the recording in various sounds. Now I have to use the reverse voice.
Please suggest me what should I do.
Thanks
There is no direct way to achieve such feature on audio file.
My suggestion to do this is to crearte chunks of audio files and merge them in reverse orderin one audio file.
You can use AVMutableComposition,AVMutableCompositionTrack,AVAssetExportSession APIs to achieve this.
You can also get more help from trimming movie file mentioned in Apple documents and same you can do for audio file.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Iphone sdk support for playing mp3 files over the network
I need to play a .mp3 in my iPhone app. The .mp3 is on a server, and I just have the URL of it. It would be nice if it could be played in a UIWebView. In any case I want to stay in my app, and stream it.
The easiest way is to use MPMoviePlayerController. Despite the name, it fully supports audio-only streaming.
What omz said.
Btw, this is a very nice article which gives an overview of the history of iDevice media APIs:
http://cocoawithlove.com/2011/03/history-of-ios-media-apis-iphone-os-20.html
It will give you some idea of the options available.
This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
Play alert sound (same as default message ringtone)
Hi,
How to get and play iPhone default Sound files in iPhone.
You can do this, but it's undocumented. You wouldn't be able to do this in an App Store app. See here: Play alert sound (same as default message ringtone)
This question already has answers here:
iPhone App › Add voice recognition? [closed]
(4 answers)
Closed 9 years ago.
Is there any via which we can identify the speech saved by the user at any time.what i want to do i want to save some user voices in the iphone and when user call any one sound iphone should react on that way i.e like if i say camera it would open the camera and if i say gallry it would open the photo gallery.
Is there any API provided by apple in any SDK upto 4.0 beta.or we have to use any third party tool for it .
Thanks
There's no api as far as i know... Overall iPhone isn't a kind of device you want to do such things on, in terms of performance at least. The regular scheme to do speech recognition on the iphone is to sample the mic, send the recorded stuff onto server, and fetch the result.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm trying to implement a progressive download audio player for the iPhone, using http and fixed size mp3-files.
I found the AudioStreamer project but it seems very complicated and works best with endless streams.
I need to be able to find out the total length of audio files and I also need to be able to seek in the files. I found a hacked deviation from AudioStreamer but it doesn't seem to work very well for me. http://www.saygoodnight.com/?p=14
I'm wondering if there is a simpler way to achieve my goals or if there are some better working samples out there? I found the bass library but not much documentation about it.
/Br Johannes
There's unfortunately nothing simple about playing audio streams on the iPhone. Here's the article that got me started:
Streaming and playing an MP3 stream
It's an OSX project, but most of it will work with the iPhone too. As for getting the full play time of it, you'd probably have to figure that out based on the content-length property of http header, provided it's a CBR file. Otherwise, I imagine you'd have to download the entire file before determining that.
If you only need to play MP3 files, why are you writing your own downloader/player? You have a few options built into iOS, each of which support progressive download and MP3 playback:
MPMoviePlayerController
AVPlayer
Safari <audio> player
I've personally had issues with the progressive download capabilities of MPMoviePlayerController and AVPlayer, so perhaps this is your issue also. I've found that these players try to be smart by requesting the mp3 multiple times, checking to see if the server supports progressive download via http range offsets. But when the server doesn't support range offsets the file is downloaded multiple times, eating bandwidth (!).
In my latest project I embedded a UIWebView having a html <audio> tag embedded. The Safari player seems to behave better than AVPlayer and MPMoviePlayerController, but it had its own caveats as well. For one, getting autoplay to work was a PITA.
There's a really good chapter about streaming audio in iPhone Cool Projects.
http://apress.com/book/view/9781430223573
It shows a simpler approach then AudioStreamer (Using NSURLConnection instead of CFNetwork), better suited for progressive downloading, and no multi threading code.
And for finding out the size of the audio file you can use [response expectedContentLength] in
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
I know this is a rather old post, but wanted to suggest a solid library that is open source. It is based on Matt Gallagher's original post recommended by #pzearfoss above. The current version uses AudioUnits now, rather than the AudioQueue classes, so it gives you access to the raw PCM samples for any manipulation you want to make (filtering, etc.) before playback. It also gives you progressive download capabilities for free, with rather minimal effort. The library seems to be actively updated which is a huge plus!
StreamingKit by #tumtumtum