views:

50

answers:

2

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 (without comunicating with the sound driver directly).

+1  A: 

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

Caladain
PlaySound is definitely NOT a low level function...
GameZelda
The winapi sound functions linked are the lowest sound api's i know. Maybe someone else knows the secret redmond magic better than i do
Caladain
+1  A: 

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.

selbie