【发布时间】:2016-03-12 15:43:44
【问题描述】:
我正在构建一个钢琴控制台应用程序,它会在特定时间段内以特定频率播放哔声/音调。帮助 最终只要按下该键就会播放音调。 P.S 最终会同时播放几个音调
namespace something
{
public class piano
{
[DllImport("kernel32.dll")]
static extern bool Beep(uint dwFreq, uint dwDuration);
public static void Main (string [] args)
{
Console.WriteLine("This is a piano.");
//The following code is wrong but you get the idea
char x = KeyDown;
switch(x)
case "q":
Beep(523,500);
break;
case "w":
Beep(587,500);
break;
//etc
default:
break;
}
}
}
【问题讨论】:
-
你的问题到底是什么??