SilentEye 0.4.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes

SilentEyeFramework::Audio Class Reference

Generic representation of audio which can load and hide specific data according to it's format. More...

#include <audio.h>

Inheritance diagram for SilentEyeFramework::Audio:
SilentEyeFramework::Media SEFormatWAV::AudioWav

List of all members.

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

Detailed Description

Generic representation of audio which can load and hide specific data according to it's format.

Definition at line 27 of file audio.h.


Constructor & Destructor Documentation

SilentEyeFramework::Audio::Audio ( const QString &  filepath)
SilentEyeFramework::Audio::Audio ( const Audio aud)
SilentEyeFramework::Audio::Audio ( Audio aud)
SilentEyeFramework::Audio::~Audio ( )

Definition at line 58 of file audio.cpp.


Member Function Documentation

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]

WAV file header length in octets.

Definition at line 77 of file audio.h.

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]
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().


Member Data Documentation

AudioFormat: PCM = 1 (i.e. Linear quantization) Values other than 1 indicate some form of compression.

Definition at line 40 of file audio.h.

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().

bit rate (bit/s)

Definition at line 60 of file audio.h.

BlockAlign: == NumChannels * BitsPerSample/8 The number of bytes for one sample including all channels.

Definition at line 48 of file audio.h.

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().

ByteRate: == SampleRate * NumChannels * BitsPerSample/8.

Definition at line 46 of file audio.h.

length of the recording (in seconds)

Definition at line 58 of file audio.h.

Definition at line 63 of file audio.h.

Referenced by closeSamples(), and openSamples().

QAudioFormat SilentEyeFramework::Audio::m_format [protected]

sound format (byterate, channels, ...)

Definition at line 31 of file audio.h.

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().

SampleRate: 8000, 44100, etc.

Definition at line 44 of file audio.h.

Definition at line 64 of file audio.h.

Referenced by closeSamples(), and readSample().

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().

Subchunk1Size: 16 for PCM. This is the size of the rest of the Subchunk which follows this number.

Definition at line 38 of file audio.h.

ChunkSize.

Definition at line 35 of file audio.h.


The documentation for this class was generated from the following files: