91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 4KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-07
  • 語言: 其他
  • 標(biāo)簽: QT??PCM??WAV??

資源簡介

使用QT實現(xiàn)pcm和wav文件相互轉(zhuǎn)換,讀取wav音頻格式等。其中有些數(shù)據(jù)類型屬于qt特有如qint32, QString等完全可以轉(zhuǎn)成int,std::string,移植的話轉(zhuǎn)成相應(yīng)類型即可。

資源截圖

代碼片段和文件信息

/****************************************************************************
**
**?Copyright?(C)?2015?The?Qt?Company?Ltd.
**?Contact:?http://www.qt.io/licensing/
**
**?This?file?is?part?of?the?examples?of?the?Qt?Toolkit.
**
**?$QT_BEGIN_LICENSE:BSD$
**?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?
#include?
#include?
#include?“wavfile.h“

struct?chunk
{
????char????????id[4];
????quint32?????size;
};

struct?RIFFHeader
{
????chunk???????descriptor;?????//?“RIFF“
????char????????type[4];????????//?“WAVE“
};

struct?WAVEHeader
{
????chunk???????descriptor;
????quint16?????audioFormat;
????quint16?????numChannels;
????quint32?????sampleRate;
????quint32?????byteRate;
????quint16?????blockAlign;
????quint16?????bitsPerSample;
};

struct?DATAHeader
{
????chunk???????descriptor;
};

struct?CombinedHeader
{
????RIFFHeader??riff;
????WAVEHeader??wave;
};

WavFile::WavFile(Qobject?*parent)
????:?QFile(parent)
?????m_headerLength(0)
{

}
//isRead?==?true為讀方式,?==false?為寫方式

bool?WavFile::open(const?QString?&fileName?bool?isRead)
{
????bool?result;
????if(this->isOpen())
????????QFile::close();
????setFileName(fileName);
????if(isRead)
????????result?=?QFile::open(QIODevice::ReadOnly)?&&?readAudioForma

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????2653??2018-09-01?19:20??wavfile.h
?????文件????????7871??2018-09-01?19:20??wavfile.cpp

評論

共有 條評論