在 Qt 5.7.0 中,我通过包含这样的 Audio 对象在 qml 中播放声音:
Audio {
id: music
source: "sound/testmusic.mp3"
autoLoad: true
autoPlay: true
}
它在windows中播放,但在linux中没有。为什么不?
linux中出现的错误消息:
无法连接到服务器套接字 err = Filen eller katalogen finns inte 无法连接到服务器请求通道 jack 服务器未运行或无法启动 JackShmReadWritePtr::~JackShmReadWritePtr - 未完成 4294967295 的初始化,跳过解锁 JackShmReadWritePtr::~JackShmReadWritePtr - 未完成对于 4294967295,跳过解锁
“Filen eller katalogen finns inte”是瑞典语,应翻译为“缺少文件或目录”。
我们将声音文件转换为 ogg 并将 qml 更改为:
Audio {
id: music
source: "sound/testmusic.ogg"
autoLoad: true
autoPlay: true
}
现在它可以在 linux 上播放,但不能在 windows 上播放。
为什么不?
我在 Windows 中安装以下内容以查看可以执行的操作:
- http://downloads.xiph.org/releases/oggdsf/opencodecs_0.85.17777.exe
- https://gstreamer.freedesktop.org/data/pkg/windows/1.9.1/gstreamer-1.0-x86-1.9.1.msi
- https://gstreamer.freedesktop.org/data/pkg/windows/1.9.1/gstreamer-1.0-x86_64-1.9.1.msi
我删除了构建目录并在 Windows 中运行了该项目。沉默的。
需要做什么?