• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: wow, Pandora rocks ... how to make make my iPhone
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wow, Pandora rocks ... how to make make my iPhone


  • Subject: Re: wow, Pandora rocks ... how to make make my iPhone
  • From: Neil Mix <email@hidden>
  • Date: Fri, 21 Nov 2008 20:17:02 -0600

Heh, that's not an easy question at all, but it sounds like you understand the tradeoffs. Connection speed will vary, so you want to pull extra bytes when you can. But that increases memory usage, so you have to tradeoff memory usage versus risk of audio gaps. Meanwhile, throttling connections can create problems on the server if you're not careful, so you have yet another tradeoff there. Unfortunately I don't think there's a one-size-fits-all solution, and you have to do what's best for your situation. -Neil

On Nov 21, 2008, at 3:40 PM, Thierry Bucco wrote:

Hi,

I am developing a similar app. You are saying that you could pre- buffer. So
I have a question regarding that.


All streaming applications samples we could find on Internet don't use a
pre-buffer for received packets. Once your app receive a packet it is sent
to audioqueue parser.


I think it could be problem if the download speed is poor, because music
will stop if there no packets for audioqueue. So I am implementing
pre-buffering using a NSMutableData buffer. If data length are less that a
certain size I don't send packet to audioqueue.


In contrary if download speed is high, audioqueue will parse a lot of data
packet and add them to its queue, do you think it could be a problem ? If
yes is it possible to throttle the connection.


What is the way way to do the pre-buffering ?

Thanks for your advice.

Thierry



I think it's really just about connection handling:
- be fastidious in handling errors
- never hand an error over to the user when you can do something about
it yourself
- if your servers are reliable, timeout connections aggressively
- when a connection is interrupted, resume streaming bytes exactly
where you left off
- if you can, pre-buffer
- the best part: test, test, test :)


HTH, -Neil

On Nov 21, 2008, at 11:25 AM, John Zorko wrote:


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



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@pandora.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: wow, Pandora rocks ... how to make make my iPhone (From: Thierry Bucco <email@hidden>)

  • Prev by Date: iPhone 2.2 - AVAudioPlayer
  • Next by Date: Real-Time Audio Analysis
  • Previous by thread: Re: wow, Pandora rocks ... how to make make my iPhone
  • Next by thread: Detecting if sounds are playing in Crash Landing iPhone App sample sound Engine
  • Index(es):
    • Date
    • Thread