Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
133 views
in Technique[技术] by (71.8m points)

c++ - Detecting when a WinCE7 is playing sound

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...