Skip to contentSkip to conversation

buffer questions

DISCUSSION David Stuart 1 participant 1 message May 19, 2003

lore
Share & tools
lore
#0 lore raw

Greetings All,

Having had some of my previous questions answered, I now understand that a harware buffer is made up of periods, a period is made up of frames, and a frame is made up of x number of samples, where x is the same as the number of channels.

But, I have further (newbie-ish) types of questions which should be easy for you guys to answer :)

o If I make a buffer in my program, does it have to match the size of the hardware buffer? Is it good practice to do so?
o The readi function takes an integer representing the number of frames to read. Is it a good idea to read an entire period at once, all periods, or just a few frames?
o How does one determine the size to set for the period and the hw buffer?
o One of the alsa tutorials (http://www.equalarea.com/paul/alsa-audio.html) does a readi using "128" as the number of frames, but the buffer is declared as "short buf[128]". Does this work because there is only 1 channel?

Dave

-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge