mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 10:15:38 +08:00
AFV initial commit
This commit is contained in:
committed by
Mat Sutcliffe
parent
7030302e73
commit
b5a2f2ad13
22
src/blacksound/sampleprovider/resourcesound.cpp
Normal file
22
src/blacksound/sampleprovider/resourcesound.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "resourcesound.h"
|
||||
#include "audioutilities.h"
|
||||
|
||||
ResourceSound::ResourceSound(const QString &audioFileName)
|
||||
{
|
||||
m_wavFile = new WavFile;
|
||||
m_wavFile->open(audioFileName);
|
||||
if (m_wavFile->fileFormat().sampleType() == QAudioFormat::Float)
|
||||
{
|
||||
m_samples = convertFloatBytesTo16BitPCM(m_wavFile->audioData());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_samples = convertBytesTo16BitPCM(m_wavFile->audioData());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const QVector<qint16>& ResourceSound::audioData()
|
||||
{
|
||||
return m_samples;
|
||||
}
|
||||
Reference in New Issue
Block a user