Qt 播放Wav音频文件

时间:2019-05-17 04:11:56
【文件属性】:
文件名称:Qt 播放Wav音频文件
文件大小:4KB
文件格式:RAR
更新时间:2019-05-17 04:11:56
QSoundEffect Qt使用QSoundEffect来播放wav文件 附官方说明:This class allows you to play uncompressed audio files (typically WAV files) in a generally lower latency way, and is suitable for "feedback" type sounds in response to user actions (e.g. virtual keyboard sounds, positive or negative feedback for popup dialogs, or game sounds). If low latency is not important, consider using the QMediaPlayer class instead, since it supports a wider variety of media formats and is less resource intensive.
【文件预览】:
Qt_Play_Music_QsoundEffect
----widget_play_music.cpp(479B)
----widget_play_music.h(410B)
----Qt_Play_Music.pro(431B)
----Qt_Play_Music.pro.user(18KB)
----main.cpp(197B)
----widget_play_music.ui(1KB)

网友评论

  • 就是官方文档上的一个例子,没声音
  • 都下了 没用啊 没声音
  • 不错的资源,感谢分享。
  • 亲测有用,注意在release模式下编译完后一定要把qt安装目录下的plugins/audio这个文件夹复制到你编译出来的那个文件夹里,不然只能在debug模式下放音乐,在release模式就不行,会提示这个错误,无语了,刚刚才在*上看到这个方法的。我这边是win下的QT编译,win下测试能解决这个报错的问题。或者用windeployqt.exe xxx.exe应该也能解决这个问题。