Implements the SoundfileData interface using libsndfile. More...
#include <soundfile.hpp>
Public Member Functions | |
| SndfileData (const QString &fname) | |
| ~SndfileData () | |
| QString | error () const |
| Used to get details in case of an error. | |
| real_vec | read_channel (int channel) |
| Loads a specified channel into a real-valued vector. | |
| size_t | frames () const |
| Returns the number of audio frames in each channel. | |
| double | length () const |
| Returns the length of the audio track in seconds. | |
| int | samplerate () const |
| Returns the samplerate of the audio file in Hz. | |
| int | channels () const |
| Returns the number of channels. | |
| bool | valid () const |
| Checks if the audio file is loaded correctly and ready for use. | |
Implements the SoundfileData interface using libsndfile.
This provides support for multiple file formats: wav, ogg, flac and many others.
Definition at line 38 of file soundfile.hpp.
| SndfileData::SndfileData | ( | const QString & | fname | ) |
Definition at line 101 of file soundfile.cpp.
| SndfileData::~SndfileData | ( | ) |
Definition at line 154 of file soundfile.cpp.
| int SndfileData::channels | ( | ) | const [virtual] |
Returns the number of channels.
Implements SoundfileData.
Definition at line 126 of file soundfile.cpp.
| QString SndfileData::error | ( | ) | const [virtual] |
Used to get details in case of an error.
Implements SoundfileData.
Definition at line 111 of file soundfile.cpp.
| size_t SndfileData::frames | ( | ) | const [virtual] |
Returns the number of audio frames in each channel.
Implements SoundfileData.
Definition at line 116 of file soundfile.cpp.
| double SndfileData::length | ( | ) | const [virtual] |
Returns the length of the audio track in seconds.
Implements SoundfileData.
Definition at line 121 of file soundfile.cpp.
| real_vec SndfileData::read_channel | ( | int | channel | ) | [virtual] |
Loads a specified channel into a real-valued vector.
Implements SoundfileData.
Definition at line 136 of file soundfile.cpp.
| int SndfileData::samplerate | ( | ) | const [virtual] |
Returns the samplerate of the audio file in Hz.
Implements SoundfileData.
Definition at line 131 of file soundfile.cpp.
| bool SndfileData::valid | ( | ) | const [virtual] |
Checks if the audio file is loaded correctly and ready for use.
Implements SoundfileData.
Definition at line 106 of file soundfile.cpp.
1.7.1