-
大小: 41.75MB文件類型: .rar金幣: 1下載: 0 次發(fā)布日期: 2023-06-17
- 語言: 其他
- 標(biāo)簽: QMediaPlayer??ffmpeg??
資源簡介
1.此工具是qt 基于QAudioRecorder實(shí)現(xiàn)的錄音以及基于QMediaPlayer實(shí)現(xiàn)的錄音播放,使用ffmpeg解析音頻并且?guī)б纛l波形圖實(shí)現(xiàn),可根據(jù)需要選擇輸入、輸出音頻設(shè)備,音頻文件格式、音頻編碼格式、音頻頻率以及音頻通道數(shù)。
2.目前音頻文件時保存為wav格式的,編解器使用的是PCM,可根據(jù)需要選擇不同的音頻格式和編解碼器,目前還未支持壓縮音頻。播放音頻使用的QMediaPlayer,解碼音頻使用ffmpeg,工具里面包含ffmpeg第三方庫。
3.播放端實(shí)現(xiàn)音頻波形圖,目前只支持一個音頻通道和兩個音頻通道的波形圖,都是64位的,在windows和linux下都測試可用。
代碼片段和文件信息
/****************************************************************************
**
**?Copyright?(C)?2017?The?Qt?Company?Ltd.
**?Contact:?https://www.qt.io/licensing/
**
**?This?file?is?part?of?the?examples?of?the?Qt?Toolkit.
**
**?$QT_BEGIN_LICENSE:BSD$
**?Commercial?License?Usage
**?Licensees?holding?valid?commercial?Qt?licenses?may?use?this?file?in
**?accordance?with?the?commercial?license?agreement?provided?with?the
**?Software?or?alternatively?in?accordance?with?the?terms?contained?in
**?a?written?agreement?between?you?and?The?Qt?Company.?For?licensing?terms
**?and?conditions?see?https://www.qt.io/terms-conditions.?For?further
**?information?use?the?contact?form?at?https://www.qt.io/contact-us.
**
**?BSD?License?Usage
**?Alternatively?you?may?use?this?file?under?the?terms?of?the?BSD?license
**?as?follows:
**
**?“Redistribution?and?use?in?source?and?binary?forms?with?or?without
**?modification?are?permitted?provided?that?the?following?conditions?are
**?met:
**???*?Redistributions?of?source?code?must?retain?the?above?copyright
**?????notice?this?list?of?conditions?and?the?following?disclaimer.
**???*?Redistributions?in?binary?form?must?reproduce?the?above?copyright
**?????notice?this?list?of?conditions?and?the?following?disclaimer?in
**?????the?documentation?and/or?other?materials?provided?with?the
**?????distribution.
**???*?Neither?the?name?of?The?Qt?Company?Ltd?nor?the?names?of?its
**?????contributors?may?be?used?to?endorse?or?promote?products?derived
**?????from?this?software?without?specific?prior?written?permission.
**
**
**?THIS?SOFTWARE?IS?PROVIDED?BY?THE?COPYRIGHT?HOLDERS?AND?CONTRIBUTORS
**?“AS?IS“?AND?ANY?EXPRESS?OR?IMPLIED?WARRANTIES?INCLUDING?BUT?NOT
**?LIMITED?TO?THE?IMPLIED?WARRANTIES?OF?MERCHANTABILITY?AND?FITNESS?FOR
**?A?PARTICULAR?PURPOSE?ARE?DISCLAIMED.?IN?NO?EVENT?SHALL?THE?COPYRIGHT
**?OWNER?OR?CONTRIBUTORS?BE?LIABLE?FOR?ANY?DIRECT?INDIRECT?INCIDENTAL
**?SPECIAL?EXEMPLARY?OR?CONSEQUENTIAL?DAMAGES?(INCLUDING?BUT?NOT
**?LIMITED?TO?PROCUREMENT?OF?SUBSTITUTE?GOODS?OR?SERVICES;?LOSS?OF?USE
**?DATA?OR?PROFITS;?OR?BUSINESS?INTERRUPTION)?HOWEVER?CAUSED?AND?ON?ANY
**?THEORY?OF?LIABILITY?WHETHER?IN?CONTRACT?STRICT?LIABILITY?OR?TORT
**?(INCLUDING?NEGLIGENCE?OR?OTHERWISE)?ARISING?IN?ANY?WAY?OUT?OF?THE?USE
**?OF?THIS?SOFTWARE?EVEN?IF?ADVISED?OF?THE?POSSIBILITY?OF?SUCH?DAMAGE.“
**
**?$QT_END_LICENSE$
**
****************************************************************************/
#include?“audiolevel.h“
#include?
AudioLevel::AudioLevel(QWidget?*parent)
??:?QWidget(parent)
{
????setMinimumHeight(15);
????setMaximumHeight(50);
}
void?AudioLevel::setLevel(qreal?level)
{
????if?(m_level?!=?level)?{
????????m_level?=?level;
????????update();
????}
}
void?AudioLevel::paintEvent(QPaintEvent?*event)
{
????Q_UNUSED(event);
????QPainter?painter(this);
????//?draw?level
????qreal?widthLevel?=?m_level?*?width();
????painter.fillRect(0?0?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3144??2020-09-25?10:35??audiorecorder\audiolevel.cpp
?????文件???????2879??2019-01-15?13:20??audiorecorder\audiolevel.h
?????文件??????19324??2020-09-10?10:02??audiorecorder\audiorecorder.cpp
?????文件???????4031??2020-09-10?10:00??audiorecorder\audiorecorder.h
?????文件????????954??2020-09-25?10:47??audiorecorder\audiorecorder.pro
?????文件??????23905??2020-09-25?10:34??audiorecorder\audiorecorder.pro.user
?????文件???????5465??2020-09-25?10:34??audiorecorder\audiorecorder.ui
?????文件???????3318??2020-08-20?10:46??audiorecorder\buttondelegate.cpp
?????文件????????739??2020-08-19?15:42??audiorecorder\buttondelegate.h
?????文件???????1207??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\ac3_parser.h
?????文件???????1354??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\adts_parser.h
?????文件?????212307??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\avcodec.h
?????文件???????2570??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\avdct.h
?????文件???????3111??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\avfft.h
?????文件??????10942??2020-08-10?04:29??audiorecorder\ffmpeg\include\libavcodec\bsf.h
?????文件??????16370??2020-08-10?04:29??audiorecorder\ffmpeg\include\libavcodec\codec.h
?????文件???????3847??2020-08-10?04:29??audiorecorder\ffmpeg\include\libavcodec\codec_desc.h
?????文件??????15240??2020-08-10?04:29??audiorecorder\ffmpeg\include\libavcodec\codec_id.h
?????文件???????7090??2020-08-10?04:29??audiorecorder\ffmpeg\include\libavcodec\codec_par.h
?????文件???????2853??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\d3d11va.h
?????文件???????4044??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\dirac.h
?????文件???????3715??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\dv_profile.h
?????文件???????2361??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\dxva2.h
?????文件???????1650??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\jni.h
?????文件???????3450??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\mediacodec.h
?????文件??????23373??2020-08-10?04:29??audiorecorder\ffmpeg\include\libavcodec\packet.h
?????文件???????3763??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\qsv.h
?????文件???????2297??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\vaapi.h
?????文件???????5796??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\vdpau.h
?????文件???????4785??2019-06-13?23:19??audiorecorder\ffmpeg\include\libavcodec\version.h
............此處省略185個文件信息
評論
共有 條評論