I'm trying to make my embedded program play sound.
For that, I've figured out that PlaySound
works flawlessly, but I want to run it async.
Now I'm having a problem because I don't know when the audio is playing and when it's not so that some sounds can't be playing one over the other.
Is there a way to detect when the audio is playing, maybe with integrated methods?
I've tried it with
TCHAR lpszCommand[128];
int result = _stprintf_s(
lpszCommand,
TEXT("info %s %s %s"),
"-1",
"file",
"wait"
);
if(result == -1){
return false;
}
//char* ret = new char[50];
MCIERROR err;// = mciSendString(lpszCommand, &ret, 50, NULL);
WCHAR buf[50];
wsprintf(buf, "%s",ret)
MyOutputDebugString(buf);
but I don't seem to be able to compile, because MCIERROR is missing. I did include windows.h
and mmsystem.h
, but to no avail.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…