tags:

views:

42

answers:

1

Is there a way to take complete control of the motherboard speaker in Windows? So, instead of calling a function like this:

beep(durationMs, frequency);

I can use:

beepContinuous(frequency);

So all I have to specify is a frequency and it will output the correct voltage to play that frequency.

A: 

There's a good discussion of a bunch of audio API choices on this SO question. The most basic technique is to use the waveOut calls in the Waveform Audio API set.

mtrw
I am not sure that this answers the question. The OP is talking about the internal speaker, i.e. the primitive speaker (or "beeper") on the motherboard, not the computer's normal audio output. I am not sure that the waveOut API functions can use the internal speaker. Can they?
Andreas Rejbrand
@Andreas Rejbrand - On my laptop, both `Beep` and `waveOut` refer to the same device - I hear both on the headphone jack. There's a couple of functions that allow enumerating all the devices: `waveOutGetNumDevs` and `waveOutGetDevCaps`. I'm not sure that modern PCs still have a separate speaker with that simple speaker driver.
mtrw