Hello, all ...
Last night on the way home, I started my Magnatune iPhone app and
tried to stream an album. On the 101, it was playing well enough,
but as the 3G signal faded / EDGE came in / 3G came back / etc., I
found that my audio app doesn't handle that so well. Sometimes my
error message shows up when it can't get the bytes from the server,
sometimes it just crashes.
"Well, let's see if Pandora on the iPhone does any better!" I said.
So, I started Pandora for the rest of the drive home, and -- sigh --
wow, it was a _lot_ better. It apparently tries to reconnect to the
stream when the connection is dropped, it handled the transition
between 3G and EDGE with barely a hiccup, and it never crashed. I
thought Pandora on the iPhone rocked before, but now that I see how
it handles variable network conditions, my respect for it has only
increased.
"How can I make my app that cool?" I asked. I've a few ideas, but
i'd love to hear from others as well.
1. I could make my audio buffers smaller and just have more of them,
vs. larger (64k) and fewer audio buffers -- I think over slower
connections, this would result in audio playing sooner.
2. I could try to reconnect to the stream when it disconnects (this
might mean abandoning NSURLConnection and going to CFSocket or even
BSD sockets and asking for the correct range from the server)
... i'm open to other ideas on how I can make my iPhone radio app
more like Pandora in this respect. I really want to make it the
best I can make it, put my best foot forward, etc. I like
developing for this platform and want to do it right.
Regards,
John
Falling You - exploring the beauty of voice and sound
http://www.fallingyou.com