SilentEye 0.4.1
|
Generic representation of audio which can load and hide specific data according to it's format. More...
#include <audio.h>
Public Member Functions | |
Audio (const QString &filepath) | |
Audio (const Audio &) | |
Audio (Audio *) | |
~Audio () | |
virtual double | duration () |
virtual quint32 | bitRate () |
virtual QAudioFormat | format () const |
Static Public Member Functions | |
static int | headerLength () |
WAV file header length in octets. | |
Protected Member Functions | |
bool | openSamples () |
Open current file and set cursor on data. | |
bool | hasNextSample () |
Can we read one more sample ? | |
QList< quint32 > | readSample () |
Read next sample (all channels) | |
void | skipSample (qint32) |
Skip some sample. | |
bool | closeSamples () |
Close file. | |
qint32 | sampleSize () const |
Number of sample in the file. | |
void | readWaveHeader () |
load header information from current wav file | |
void | writeWaveHeader (QDataStream &) |
write header information on given stream | |
Protected Attributes | |
QAudioFormat | m_format |
sound format (byterate, channels, ...) | |
quint32 | m_totalSize |
ChunkSize. | |
quint32 | m_subFmtSize |
Subchunk1Size: 16 for PCM. This is the size of the rest of the Subchunk which follows this number. | |
quint16 | m_audioFormat |
AudioFormat: PCM = 1 (i.e. Linear quantization) Values other than 1 indicate some form of compression. | |
quint16 | m_numChannels |
NumChannels: Mono = 1, Stereo = 2, etc. | |
quint32 | m_sampleRate |
SampleRate: 8000, 44100, etc. | |
quint32 | m_byteRate |
ByteRate: == SampleRate * NumChannels * BitsPerSample/8. | |
quint16 | m_blockAlign |
BlockAlign: == NumChannels * BitsPerSample/8 The number of bytes for one sample including all channels. | |
quint16 | m_bitPerSample |
BitsPerSample: 8 bits = 8, 16 bits = 16, etc. | |
quint32 | m_subDataSize |
Subchunk2Size: == NumSamples * NumChannels * BitsPerSample/8 This is the number of bytes in the data. You can also think of this as the size of the read of the subchunk following this number. | |
QAudioFormat::Endian | m_byteOrder |
byte ordering assumed for WAVE data (little-endian for RIFF, big-endian for RIFX) | |
double | m_duration |
length of the recording (in seconds) | |
quint32 | m_bitRate |
bit rate (bit/s) | |
Private Attributes | |
QFile | m_file |
QDataStream | m_sampleStream |
Generic representation of audio which can load and hide specific data according to it's format.
SilentEyeFramework::Audio::Audio | ( | const QString & | filepath | ) |
SilentEyeFramework::Audio::Audio | ( | const Audio & | aud | ) |
Definition at line 40 of file audio.cpp.
References SilentEyeFramework::m_type, SilentEyeFramework::readWaveHeader(), and SEFormatBMP::setObjectName().
SilentEyeFramework::Audio::Audio | ( | Audio * | aud | ) |
Definition at line 49 of file audio.cpp.
References SilentEyeFramework::m_type, SilentEyeFramework::readWaveHeader(), and SEFormatBMP::setObjectName().
quint32 SilentEyeFramework::Audio::bitRate | ( | ) | [virtual] |
Definition at line 179 of file audio.cpp.
Referenced by SilentEye::PropertyDialog::setMedia().
bool SilentEyeFramework::Audio::closeSamples | ( | ) | [protected] |
Close file.
Definition at line 239 of file audio.cpp.
References m_file, and m_sampleStream.
Referenced by SEFormatWAV::AudioWav::loadData(), and SEFormatWAV::AudioWav::saveToDir().
double SilentEyeFramework::Audio::duration | ( | ) | [virtual] |
Definition at line 174 of file audio.cpp.
Referenced by SilentEye::PropertyDialog::setMedia().
QAudioFormat SilentEyeFramework::Audio::format | ( | ) | const [virtual] |
Definition at line 169 of file audio.cpp.
Referenced by SilentEye::PropertyDialog::setMedia().
bool SilentEyeFramework::Audio::hasNextSample | ( | ) | [protected] |
Can we read one more sample ?
Definition at line 209 of file audio.cpp.
Referenced by SEFormatWAV::AudioWav::loadData(), and SEFormatWAV::AudioWav::saveToDir().
static int SilentEyeFramework::Audio::headerLength | ( | ) | [inline, static] |
bool SilentEyeFramework::Audio::openSamples | ( | ) | [protected] |
Open current file and set cursor on data.
Definition at line 188 of file audio.cpp.
References m_file.
Referenced by SEFormatWAV::AudioWav::loadData(), and SEFormatWAV::AudioWav::saveToDir().
QList< quint32 > SilentEyeFramework::Audio::readSample | ( | ) | [protected] |
Read next sample (all channels)
Definition at line 217 of file audio.cpp.
References m_sampleStream.
Referenced by SEFormatWAV::AudioWav::loadData(), and SEFormatWAV::AudioWav::saveToDir().
void SilentEyeFramework::Audio::readWaveHeader | ( | ) | [protected] |
load header information from current wav file
Definition at line 63 of file audio.cpp.
References SilentEyeFramework::Media::m_filePath.
qint32 SilentEyeFramework::Audio::sampleSize | ( | ) | const [protected] |
Number of sample in the file.
Definition at line 184 of file audio.cpp.
Referenced by SEFormatWAV::AudioWav::capacity(), SEFormatWAV::AudioWav::computeDistributionStep(), SEFormatWAV::AudioWav::loadData(), and SEFormatWAV::AudioWav::saveToDir().
void SilentEyeFramework::Audio::skipSample | ( | qint32 | length | ) | [protected] |
Skip some sample.
Definition at line 234 of file audio.cpp.
Referenced by SEFormatWAV::AudioWav::loadData().
void SilentEyeFramework::Audio::writeWaveHeader | ( | QDataStream & | stream | ) | [protected] |
write header information on given stream
Definition at line 250 of file audio.cpp.
Referenced by SEFormatWAV::AudioWav::saveToDir().
quint16 SilentEyeFramework::Audio::m_audioFormat [protected] |
quint16 SilentEyeFramework::Audio::m_bitPerSample [protected] |
BitsPerSample: 8 bits = 8, 16 bits = 16, etc.
Definition at line 50 of file audio.h.
Referenced by SEFormatWAV::AudioWav::loadData(), and SEFormatWAV::AudioWav::saveToDir().
quint32 SilentEyeFramework::Audio::m_bitRate [protected] |
quint16 SilentEyeFramework::Audio::m_blockAlign [protected] |
QAudioFormat::Endian SilentEyeFramework::Audio::m_byteOrder [protected] |
byte ordering assumed for WAVE data (little-endian for RIFF, big-endian for RIFX)
Definition at line 55 of file audio.h.
Referenced by SEFormatWAV::AudioWav::saveToDir().
quint32 SilentEyeFramework::Audio::m_byteRate [protected] |
double SilentEyeFramework::Audio::m_duration [protected] |
QFile SilentEyeFramework::Audio::m_file [private] |
Definition at line 63 of file audio.h.
Referenced by closeSamples(), and openSamples().
QAudioFormat SilentEyeFramework::Audio::m_format [protected] |
quint16 SilentEyeFramework::Audio::m_numChannels [protected] |
NumChannels: Mono = 1, Stereo = 2, etc.
Definition at line 42 of file audio.h.
Referenced by SEFormatWAV::AudioWav::loadData(), SEFormatWAV::AudioWav::saveToDir(), and SEFormatWAV::AudioWav::setNbChannelUsed().
quint32 SilentEyeFramework::Audio::m_sampleRate [protected] |
QDataStream SilentEyeFramework::Audio::m_sampleStream [private] |
Definition at line 64 of file audio.h.
Referenced by closeSamples(), and readSample().
quint32 SilentEyeFramework::Audio::m_subDataSize [protected] |
Subchunk2Size: == NumSamples * NumChannels * BitsPerSample/8 This is the number of bytes in the data. You can also think of this as the size of the read of the subchunk following this number.
Definition at line 53 of file audio.h.
Referenced by SEFormatWAV::AudioWav::loadData(), and SEFormatWAV::AudioWav::saveToDir().
quint32 SilentEyeFramework::Audio::m_subFmtSize [protected] |
quint32 SilentEyeFramework::Audio::m_totalSize [protected] |