Qt 在其他设备上不播放声音

Qt doesn't play sound on other devices

我只想用 Qt 编写一个程序来播放一个简单的 .wav 文件。 这在我的 Qt 运行s 所在的 PC 上完美运行,但每当我想 运行 另一台计算机上的程序时,就没有声音。 我在任何地方都找不到解决这个问题的方法。

这是我目前尝试的方法:

QFile dir("C:/Sounds/countdown3.wav"); if(dir.exists()){ ui->labelSound->setText("File found!"); ui->pushButtonPlay->setEnabled(true); ui->labelplay->setEnabled(true); ui->pushButton->setEnabled(false); } else ui->labelSound->setText("File not available!");

(当我重命名文件时,我收到 "File not available!" 消息,所以这有效。)

为了将程序从我的电脑部署到我的笔记本电脑,我将以下内容放入文件夹中:

和 "Sounds" 文件夹 countdown3.wav 到 C:/ - 驱动器。仍然没有声音:(

我错过了什么?

希望你能帮帮我!

音频插件文件夹:[Qt-Installation].4\msvc2013\plugins\audio

  1. audio\qtaudio_windows.dll你需要什么
  2. audio\qtaudio_windowsd.dll是调试库
  3. audio\qtaudio_windowsd.pdb 个符号

您不需要部署最后两个。