Beep音乐程序

C++中使用Beep也可以进行谱曲。

void HappyBirthday (void)
{
    unsigned FREQUENCY[] = {392,392,440,392,523,494,   
        392,392,440,392,587,523,   
        392,392,784,659,523,494,440,   
        689,689,523,587,523};   

    unsigned DELAY[] = {375,125,500,500,500,1000,   
        375,125,500,500,500,1000,   
        375,125,500,500,500,500,1000,   
        375,125,500,500,500,1000};   for (int i = 0; i < 25; i++)   
    {   
        Beep(FREQUENCY[i], DELAY[i]);   
    } 
}

太神奇了。

posted @ 2012-04-09 21:30  陈朋  阅读(355)  评论(0编辑  收藏  举报