Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-12-2009, 10:42 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2009
Posts: 15
Default Reusing an audio queue

My problem is simple but the solution is elusive.

I am using the iPhone SDK Core Audio Services to play a real-time audio stream (e.g. internet radio station) based on the SpeakHere example.

My code works just fine the first time around, but when I change streams or restart the stream without stoping and reloading the app the audio queue has extra noise in it (jitter, skips, etc).

I've tried many things like:
1. AudioQueuePrime before playing new buffers.
2. AudioQueueFlush with and without waiting for buffer to finish before AudioQueueStop (with immediate set to yes and no) and AudioQueueDispose.
3. AudioQueueReset along with and without 1 and 2 above.
4. I've freed the audio queue and built a new one for each stream change
5. I've lowered and raised the gain before playing a new stream.
6. I've put sleeps and NSThread..sleeps to see if the audio queue needed time to reset between streams.
7. I've checked that all my variables are reinitialized, zeroized, etc.
8. Many combinations of 1 thru 7.

But none of these things worked.

The only thing that seems to work is if I set the audio queue buffers to larger than necessary values (like using a 128kbps buffer for a 64kbps stream), but this seems inefficient and causes a longer delay for the music to start.

I see lots of posts for this problem and no good solutions.

Anyone?
kenroyandfamily is offline   Reply With Quote
Reply

Bookmarks

Tags
audio, jitter, problem, queue, reuse

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 241
22 members and 219 guests
ADY, Alsahir, beleg_1998, Dani77, diyora, FAED, fredidf, iDifferent, iph_s, JamesCahall, JasonR, mer10, prchn4christ, Robiwan, Rudy, smithdale87, Speed, spiderguy84, stekki, tgjorgoski, timle8n1, twerner
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,755
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:13 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0