What's the lowest level Windows function(s) to play sound?
What's the lowest level Windows function(s) to play sound? (The function(s) that are called by any other functions that play sound).
For example, fopen() calls CreateFileA(), and CreateFileA() calls CreateFileW(), and CreateFileW() calls NtCreateFile(), etc. I want to know what's the lowest-level one for sound (withou开发者_JS百科t comunicating with the sound driver directly).
PlaySound would be as low as i would go.
http://msdn.microsoft.com/en-us/library/aa909766.aspx
But check out all the winapi sound functions on MSDN
http://msdn.microsoft.com/en-us/library/aa909811.aspx
On Vista and Win7, you can use WASAPI. If that's too low level (as much of it is geared for pro-audio tools), you can look at the Wave and DirectSound APIs to stream buffers of audio out to the speakers. There's also the XACT/XNA stuff for games. All of these APIs ultimately sit on top of WASAPI, but are likely easier to use.
If you just want to Play a WAV file from time to time without any notification or mixing support, its hard to beat PlaySound.
精彩评论