Re: wow, Pandora rocks ... how to make make my iPhone
Re: wow, Pandora rocks ... how to make make my iPhone
- Subject: Re: wow, Pandora rocks ... how to make make my iPhone
- From: Thierry Bucco <email@hidden>
- Date: Fri, 21 Nov 2008 16:40:11 -0500
- Thread-topic: wow, Pandora rocks ... how to make make my iPhone
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:
This email sent to email@hidden