RE: Streaming WAVE audio

"Johnson, James" <[email protected]>
Newsgroups gmane.games.devel.windows
Message-ID <[email protected]>

Buffer size and latency are different things. When a sound is queued it
is immediately mixed into the current playing header sometime ahead of
the current play position. On good hardware I was able to mix audio
10-15ms ahead of the play position without error. However like you, I
discovered that to support most/all systems I had to mix a bit further
ahead of the playback position; 50ms is what I chose.

When I wrote this system I had some doubt about modifying the buffer
addressed by a prepared and written WAVEHDR. The doco wasn't exactly
clear on this point. It clearly states what members can be modified in
the WAVEHDR after prepared, but doesn't mention the PCM data addressed
by the header. I'm curious if others have had problems with this mixing
strategy besides the obvious recomposition of the remaining playing
buffer.

James

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Jon Watte
Sent: Tuesday, July 13, 2004 11:40 PM
To: [email protected]
Subject: RE: [GD-Windows] Streaming WAVE audio


> 2) On some system there appears to be a minimum required buffer size,
> e.g. at least 250ms. On systems like these I got silence at best, and
> lock up at worst. I didn't spend a lot of time investigating this
> because 250ms is pretty short buffer. I was shooting for 4/8/16k
> buffer sizes at that time. In the end I don't think it matters.

250 ms is a REALLY BIG buffer. 250 ms of latency means you pull the
trigger now, and hear the gunshot sound when the target's already dead.
(When I say "buffer" I really mean "WAVHDR chunk").

I've found that once I went above 40 ms buffers, and used at least 3
buffers, any hardware I tested on worked well. Less that that in either
variable caused problems. Note that the scheduler on Win98 is VERY
jittery -- 20 ms scheduling jitter is common, and it can jerk higher
than that, even on a quiescent system with a fast CPU.

> Furthermore I recommend not using the ACM to up/down sample as it
> appears to perform point sampling(!) which can produce terrible audio.

I always code my own re-sampler, which sits at the reader/input stage of
the mixer, which I also code on my own, for the WAVE output. I prefer to
use cubic Hermite interpolation, which runs fast and sounds good.

Cheers,

			/ h+


----------------------------------------------------
Vivendi Universal Games- <<http://www.vugames.com>>:
The information transmitted is intended only for the
person or entity to which it is addressed and may
contain confidential and/or privileged material of
Vivendi Universal Games which is for the exclusive
use of the individual designated above as the
recipient. Any review, retransmission, dissemination
or other use of, or taking of any action in reliance
upon, this information by persons or entities other
than the intended recipient is prohibited. If you
received this in error, please contact immediately
the sender by returning e-mail and delete the
material from any computer. If you are not the
specified recipient, you are hereby notified that
all disclosure, reproduction, distribution or action
taken on the basis of this message is prohibited.


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_idU5
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.