Qt使用QSound播放声音(支持WAV,不支持MP3)

 

相关资料:

https://www.ebaina.com/articles/140000004830   qt 用QSound播放音频文件

https://download.csdn.net/download/zhujianqiangqq/19518919    代码包下载

.pro

 1 QT       += core gui
 2 QT       += multimedia
 3 
 4 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 5 
 6 CONFIG += c++11
 7 
 8 # The following define makes your compiler emit warnings if you use
 9 # any Qt feature that has been marked deprecated (the exact warnings
10 # depend on your compiler). Please consult the documentation of the
11 # deprecated API in order to know how to port your code away from it.
12 DEFINES += QT_DEPRECATED_WARNINGS
13 
14 # You can also make your code fail to compile if it uses deprecated APIs.
15 # In order to do so, uncomment the following line.
16 # You can also select to disable deprecated APIs only up to a certain version of Qt.
17 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
18 
19 SOURCES += \
20     main.cpp \
21     mainwindow.cpp
22 
23 HEADERS += \
24     mainwindow.h
25 
26 FORMS += \
27     mainwindow.ui
28 
29 # Default rules for deployment.
30 qnx: target.path = /tmp/$${TARGET}/bin
31 else: unix:!android: target.path = /opt/$${TARGET}/bin
32 !isEmpty(target.path): INSTALLS += target
View Code

相关文章:

  • 2021-12-25
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
  • 2021-10-25
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案