c sound.txt

来自「A simple program to generate sound in C+」· 文本 代码 · 共 25 行

TXT
25
字号
//Sound Demo
//By Nikhilio
//
#include <iostream>
#include <windows.h>
#include <mmsystem.h> //Windows multimedia stuff
#include <winbase.h> //defines sleep function

// If you get weird link errors, make sure that your compiler knows
// where to find winmm.lib


void main(void)
{
char filename[255]="baloney.wav"; //file must be in same directory as executeable

sndPlaySound(filename,SND_SYNC);
//using SND_ASYNC will cause program execution to continue
//using SND_SYNC will cause the program to halt execution until
//the sound is done playing
//using SND_LOOP will cause the sound to play over and over.
//SND_LOOP must be used with SND_SYNC like so,
//sndPlaySound(filename, SND_SYNC | SND_LOOP);;

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?