Re: SDL_QueueAudio underrun

David Olofson <[email protected]>
Newsgroups gmane.comp.lib.sdl
Message-ID <CAAcqxQrGMPHCfRwH0fr_o8F9J-jczcGY81xCwEPFgjQzOsM5LQ@mail.gmail.com>
On Thu, Oct 20, 2016 at 9:34 AM, Timothy Macintyre
<[email protected]> wrote:
> But I still then end up with gaps as this is a live stream I have to discard
> several of the opus packets whilst the buffer goes down. It doesn't make
> sense that the buffer is filling up that much, it should be playing just as
> fast as I fill it up.

Ah...! But then the sample rate of the stream isn't matching the audio
interface. Even if you set them up to exactly the same value, you
can't rely on them matching exactly, because even the finest crystal
oscillators aren't infinitely accurate. The only common situation I
can think of where you do NOT have this problem is in studios, between
local audio interfaces synchronized via wordclock or similar.

However, one can usually get away with just inserting or dropping a
single sample frame every once in a while, so I'm kind of wondering if
you even have the right nominal sample rates... For example, 44 kHz vs
the standard 44.1 kHz would be a problem, and would probably require
proper resampling to avoid constant audible artifacts.


-- 
//David Olofson - Consultant, Developer, Artist, Open Source Advocate

.--- Games, examples, libraries, scripting, sound, music, graphics ---.
|   http://consulting.olofson.net          http://olofsonarcade.com   |
'---------------------------------------------------------------------'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.