Play Audio URLs from the iPhone Command Line
You never know when instant karma is gonna getcha. Take my playaudio application. Yesterday, I was chatting with some developer buddies about maybe putting together an Internet radio application and discussing the fact that the Celestial iPhone framework is essentially QuickTime repackaged. While talking, I decided to try using my existing playaudio app with a URL rather than a local audio file. So I typed the following at the iPhone command line:
playaudio http://steiner.math.nthu.edu.tw/ne01/tjy/music/06.I%20Just%20Called%20To%20Say%20I%20Love%20You.mp3
And...it worked. Just like that, the instrumental-only cover began to play back through my iPhone speakers. Apparently, Apple has merged the concept of "local file" and "URL" a lot more closely than I'd thought. I haven't had any luck connecting to .pls or any other live radio feed but if you'd like to play back Internet-based files, playaudio works just fine.


![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 1)
Robert said 1:25PM on 8-17-2007
If it wasn't for Installer.app I wouldn't even know you had a package of utils. Any documentation on them?
Reply
AskTheAdmin said 1:56PM on 8-17-2007
This didnt work on our iPhone - any ideas?
http://www.askTheAdmin.com
Reply
DrunkDwarf said 2:08PM on 8-17-2007
The iPhone currently has no support at all for RTSP or any other streaming media protocol.
Playing media files (mp3, mp4 etc) from a URL requires that the web server support position-able http get requests. The iPhone then uses this ability to provide a position in the file and a size to request roughly 32KB chunks (on WiFi, smaller on EDGE) of the file to play.
This lets the iPhone dodge a big chunk of cranky code to get working on a heavily power managed battery powered mobile device.
Reply
Court Kizer said 9:34PM on 8-17-2007
This might be useful if the Terminal.app for the iPhone had a working delete key instead of inserting ^H everytime.
Reply
setec said 10:05PM on 8-19-2007
the above url you want us to cut and paste didn't seem to show up right when loading this page in Safari. Just in case anyone else has the problem, here is the link, which worked for me as well.
http://steiner.math.nthu.edu.tw/ne01/tjy/music/06.I%20Just%20Called%20To%20Say%20I%20Love%20You.mp3
Reply
michelle21 said 12:51PM on 8-25-2007
Guys, please take a look at this demo video of our application and watch for the alpha in a week or so, streaming audio and video from the iphone is not a problem.
we will do it two ways
1) upnp media servers
2) direct url's advertised using dns-sd protocol (aka bonjor)
mooncatventures.blogspot.com
Reply