Re: Calibrating Buffer Size and Count

Kip Warner <[email protected]>
Newsgroups gmane.comp.lib.openal
Message-ID <[email protected]>
On Fri, 2010-05-28 at 13:29 -0700, Chris Robinson wrote: 
> A "frame size", in this case, is the size of a single sample multiplied by the 
> channel count (ie. channels * bits / 8; which would be 4 for 16-bit stereo, or 
> 1 for 8-bit mono, for example). A "buffer size" would be the size of a given 
> buffer (typically in bytes, but sometimes it may be measured in frames or even 
> time).
> 
> So, for instance, you would generate 4 to 8 buffers, and fill them each with 
> frequency/4*channels*bits/8 bytes (where frequency, channels, and bits are 
> taken from the stream data format that's given to OpenAL):

The 4 in the divisor, is that the number of buffers one chose to
generate?

How do I determine the number of buffers to use for a stream? Do you
reckon to just hardcode it at, say, 8, and instead leave the size of the
buffers themselves as the parameter to fiddle with?

> int framesize = stream->channels * stream->bits / 8;
> BytesPerBuffer = stream->Freq / 4 * framesize;

The 4 again in the divisor is the number of buffers chosen for the
stream?

> When queued onto a source, the buffers should give a total play time of one to 
> two seconds before it all runs out, and approximately 1/4th of a second 
> between each buffer.

Very helpful Chris. I've made a note of that in my notes.

PS If you remember, please cc me so I get it faster than the batch mode
dispatches.

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEABECAAYFAkwB6W0ACgkQLXnfK7bii20QcACePLPPTsT9rSwEGGI5PwTUmZWS
mswAnRWOr3L8ZX9sKCmBG+zcxkFm3piF
=smah
-----END PGP SIGNATURE-----
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.