관련자료를 찾기위해 한참을 찾아헤맸다
결과는 너무나도 허무한 -_-;
# SndPlaySound
WORD sndPlaySound( LPSTR lpszSound, : 출력할 사운드 이름(파일이름, ID)
UINT fsSound ); : 설정 플래그( |연산가능)
WORD sndPlaySound( LPSTR lpszSound, : 출력할 사운드 이름(파일이름, ID)
UINT fsSound ); : 설정 플래그( |연산가능)
fsSound : SND_ASYNC - 재생시 다른 작업 허용하는 비동기식 작동
SND_SYNC - 재생 끝날 때까지 다른 작업 허용안함.
SND_LOOP - 재상 끝나면 처음으로 가서 다시 재생.
SND_NODEFAULT - 재생 실패시 DEFAULT 소리 차단.
SND_MEMORY - 리소스에 등록된 이름을 메모리에 올려 사용.
( SND_MEMORY를 제외하면 파일에 관한 처리)
VS6 Visual C++
프로젝트 setting -> link -> modules 부분에 winmm.lib 추가
#include <windows.h>
#include <MMsystem.h>
int main(int argc, char* argv[])
{
if(argc<1){
cout<<"wplay foo.wav"<<endl;
return 1;
}
sndPlaySound(argv[1], SND_ASYNC);
return 0;
}
VS.net C++
#include <windows.h>
#include <MMsystem.h>
#include <tchar.h>
#pragma comment (lib ,"winmm.lib")
int main(int argc, char* argv[])
{
if(argc<1){
cout<<"wplay foo.wav"<<endl;
return 1;
}
sndPlaySound(_T(argv[1]), SND_ASYNC); // type casting !!
return 0;
}
