我正在尝试用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;
}