[wdmaudiodev] Re: WASAPI exclusive mode audio render issue (2)?

  • From: Matthew van Eerde <Matthew.van.Eerde@xxxxxxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Mon, 14 Sep 2015 19:55:57 +0000

Suppose for the sake of argument the IAudioClient::Initialize format was
stereo, 16-bit integer, 44.1 kHz sampling rate.

You will need to feed the IAudioRenderClient an average of 44100 "frames" of
data every second. These will be in packets of approximately 10 milliseconds -
that is, approximately 441 frames.

Due to alignment considerations, some hardware will insist on slightly more -
perhaps packets of 448 frames, or 10.15-ish milliseconds.

Each frame consists of two "samples" which are 16-bit integers - one for the L
channel and one for the R channel.

So, yes. If GetBuffer() talks about 441 frames, you have a buffer size of 441 *
2 * 16 / 8 bytes - or more generically, GetBufferSize() *
WAVEFORMATEX.nBlockAlign bytes, where WAVEFORMATEX.nBlockAlign =
WAVEFORMATEX.nChannels * WAVEFORMATEX.wBitsPerSample / BITS_PER_BYTE.

-----Original Message-----
From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Jerry Evans
Sent: Monday, September 14, 2015 12:09 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: WASAPI exclusive mode audio render issue (2)?

Ach. Typo.

If getBuffer() claims to have filled 441 frames
- do we mean that the buffer contains 441 * n channels of data, i.e.
for
16bit
we've a total buffer size of 441 * 2 * 16? with data interleaved as
[L0][R0][L1][R1][...][Ln][Rn]

Where n == 441 of course.


******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.com/

******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.com/

Other related posts: