mciSendString覆盖多种声音

时间:2018-10-22 20:06:06

标签: c++ windows

我正在尝试用cpp制作钢琴,但是mciSendString等到声音文件结束时才播放,所以我不能重叠相同的声音。 代码:

if (asciiFinal != 0) {
        switch (asciiFinal) {
        case 97:
            std::cout << "Played" << std::endl;
            mciSendStringA(  "play C:\\Users\\Administrator\\Downloads\\1.wav", 0, 0, 0);

            break;
        default:

            std::cout << "Played" << std::endl;
            mciSendStringA("play C:\\Users\\Administrator\\Downloads\\2.wav", NULL, 0, NULL);
            break;
        }

0 个答案:

没有答案