开发者

Beep through the soundcard

I'm using beep (import from kernel) in C# to send tones through the headphone jack to another device that interprets them.

The problem is on some computers the beep occur开发者_Python百科s, but nothing is output to the hp jack. I think it's because it is using the internal speaker. How can I send it through the soundcard?


Older machines might still have a speaker, Console.Beep() will drive the speaker, not the soundcard. Not much you can do about it since this is a driver detail, but ask at superuser.com. This blog post has details about how this came about.

Check out the NAudio library for a way to generate sound through the sound card.


Get yourself a short audio clip, perhaps a .wav or .mp3 file, and play that. It will output through the user's chosen audio output device, which is almost certain to be their soundcard.


Most probably you are using 64-bit Windows. It is not supported on 64 bit. Frankly, don't use this API.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜