WIN32 API Waveform input/output

Started by
0 comments, last by Stoffel 23 years, 11 months ago
I need to write some interfaces to the waveform device using the WIN32 library. The target NT, so other APIs are not an option. I'm working on recording currently, and using the waveInOpen family of functions. My question is this: What's a good way to decide the size & number of buffers to give to the waveform device? I figure I should have an option to set N seconds buffer time (like 2-10 seconds), but how should that time be sliced-up? Do sound devices like lots of small buffers, a couple of big buffers? Is there a max buffer size I should consider for performance reasons? I'm going to try my hand at this experimentally (probably working with powers of two for the moment), and I'll let you know what I find. If anybody has any input, please let me know. Thanks! Edited by - Stoffel on 5/16/00 12:57:31 PM
Advertisement
I have NO experience with this (i do at least USE DirectSound though), so take my input as simply thinking out loud.

I believe these is NOT a consistent maximum buffer size, it''s probably much more like video memory ... different sound hardare has diff preference and capabilities ... so you simply get your program to run well on TWO sets of hardware (to avoid quirks that might be in one companies drivers), and then ... when testing time comes ... you try it on maybe the 3-5 most common target platforms (more if reasonable) and simply adjust your buffer size and quantity amounts until you have reached acceptable performance on all of the platforms (or all that CAN run it well).

If you KNOW about the issue now ... it should be realatively easy to make these things PARAMETERS to your code ... so that to change them you simply change the constants ... in the worst case (when you cannot afford ANY performance penalty) they could be simple compiler constants ... in the BEST case ... you could have tables of them stored in a file ... for different hardware (assuming that you don''t find out that one setting works well for all) you simply load the appropriate value at run-time. To get these values ... simply run a series of profiles on your program on each platform you have avalible ... then weigh the trade offs ....

GOOD LUCK!

This topic is closed to new replies.

Advertisement