VC++ 에서 소리 만들기 예제
mmsystem.h 를 인클루드 해줘야한다. #pragma comment(lib,"winmm.lib") 도 해줘야한다. [code c] void Cexercise1Dlg::OnBnClickedButton1() { WAVEFORMATEX wfme; wfme.nSamplesPerSec = 2205; wfme.nAvgBytesPerSec = 2205; wfme.nBlockAlign = 1; wfme.nChannels = 1; wfme.wBitsPerSample = 8; wfme.wFormatTag = WAVE_FORMAT_PCM; WAVEHDR whdr; MMRESULT mmres; HWAVEOUT hwout; int iSPS = 4410; int fFreq = 1000; int iBufLen = 2205; char *WaveBuf = new char[2205]; //double dKoef = 2 * 3.1416 / iSPS * fFreq; unsigned char tmp= 0x9c; for (int i=0; i ibuflen; !="MMSYSERR_NOERROR)" &="" &wfme,="" (!(whdr.dwflags="" (cos(i="" (dduration="" (dword)="" (ibuflen);="" (mmres="" *="" +="" 0){="" 125="" 127);="" ::zeromemory(&whdr,sizeof(whdr));="" ;="" ibuflen; [/code]