有好听的 kernel32 蜂鸣声(板载蜂鸣声)吗?
我想知道是否有人找到了一种很好的蜂鸣声组合,这实际上听起来像音乐。
这就是方法的调用方法。
[DllImport("Kernel32.dll")]
public static extern bool Beep(UInt32 frequency, UInt32 duration);
// ...
// call
Beep(2000, 400);
我的第一次尝试:
for (int j = 1; j < 20; j++)
{
for (int i = 1; i <= 10; i++)
{
Console.Beep(300 * i, 200);
}
}
I was wondering if anybody found a nice combination of beeps, that actually sounds like music.
This is how to call the method.
[DllImport("Kernel32.dll")]
public static extern bool Beep(UInt32 frequency, UInt32 duration);
// ...
// call
Beep(2000, 400);
My first attempt:
for (int j = 1; j < 20; j++)
{
for (int i = 1; i <= 10; i++)
{
Console.Beep(300 * i, 200);
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以使用以下简单的程序来使用
Beep
来演奏旋律:对于那些感兴趣的人:这使用了 Werckmeister 音律 并根据音分< /a> 为此气质定义的值。
You can play around with the following simple programm to play melodies using
Beep
:For those that are interested: This used a Werckmeister temperament and calculates the frequencies based on the Cent values defined for this temperament.
Beep 函数由 QBasic 的 Play 命令封装。该产品在 Google 上获得了很多点击,这是首选。编写代码来翻译 Play 字符串可能比复制粘贴更有趣。语法是此处描述。
The Beep function was wrapped by QBasic's Play command. Lots of Google hits on that one, this was the top selection. Writing the code to translate the Play string could make this a bit more interesting than copy-paste. The syntax is described here.
还有
System.Console.Beep
。There is also
System.Console.Beep
.检查 Google 中的单音铃声,然后使用十六进制编辑器打开该文件,然后对歌曲进行逆向工程。如果您的程序能够读取原始文件并将其即时转换为蜂鸣声,那就加分了。
Check Google for Monophonic Ring-tones then open the file with a hex editor and reverse engineer the songs. Bonus points if your program will read in the original file and translate it to the beeps on the fly.
曾经有一个声音驱动程序将 PC 扬声器用作 PCM 音频设备(声卡)
There used to be a sound driver that would use the PC Speaker as a PCM audio device (sound card)