我正忙着做一个混响算法。在与我合作时,QSound
我发现了一些问题。
QSound::play()
首先,尝试这样的声音不会播放:
/// Play output .wav file.
QSound sound("C:/Users/mvdelft/Documents/Reverb_configurator/output.wav", this);
sound.play();
QSound::play
如果我用(QString
文件)给出路径,它只会播放声音,如下所示:
/// Play output .wav file.
QSound sound("C:/Users/mvdelft/Documents/Reverb_configurator/output.wav", this);
sound.play("C:/Users/mvdelft/Documents/Reverb_configurator/output.wav");
我遇到的一个相关问题与bool QSound::isFinshed()
对我不起作用的功能有关。代码:
/// Play output .wav file.
QSound sound("C:/Users/mvdelft/Documents/Reverb_configurator/output.wav", this);
sound.play("C:/Users/mvdelft/Documents/Reverb_configurator/output.wav");
sound.setLoops(10);
/// Check is sound is finished
while (!sound.isFinished()){}
ui->listWidget->addItem("Finished playing sound");
}/// End of scope