Read/write multiple audio files at the same time in one background-thread. More...
#include <Resonant/AudioFileHandler.hpp>
Classes | |
| class | Handle |
| A handle that offers access to the audio files. More... | |
Public Member Functions | |
| void | done (Handle *) |
| Tells the handler, that a given file handle can be deleted. More... | |
| Handle * | readFile (const char *filename, long startFrame, Radiant::AudioSampleFormat userFormat=Radiant::ASF_FLOAT32) |
| Starts the reading process for a given file. More... | |
| void | start () |
| Start the audio file IO thread. | |
| void | stop () |
| Stop the audio file IO thread. | |
| Handle * | writeFile (const char *filename, int channels, int samplerate, int sfFormat, Radiant::AudioSampleFormat userFormat=Radiant::ASF_FLOAT32) |
| Starts the writing process for a file. More... | |
Public Member Functions inherited from Radiant::Thread | |
| bool | isRunning () const |
| Check if the thread is running. More... | |
| void | run () |
| Starts the thread. | |
| void | setName (const QString &name) |
| Set the thread name. More... | |
| Thread (const QString &name="Radiant::Thread") | |
| Construct a thread structure. More... | |
| bool | waitEnd (int timeoutms=0) |
| Waits until thread is finished. More... | |
| virtual | ~Thread () |
| Destructor. More... | |
Static Public Member Functions | |
| static bool | getInfo (const char *filename, SF_INFO *info) |
| Gets information about a given audio file. More... | |
| static AudioFileHandler * | instance () |
| Returns the first AudioFileHandler instance. More... | |
| static SNDFILE_tag * | open (const QString &filename, int openMode, SF_INFO *info) |
Static Public Member Functions inherited from Radiant::Thread | |
| static id_t | myThreadId () |
| The id of the calling thread. More... | |
Friends | |
| class | Handle |
Additional Inherited Members | |
Public Types inherited from Radiant::Thread | |
| typedef void * | id_t |
| Thread id type. More... | |
Read/write multiple audio files at the same time in one background-thread.
| void Resonant::AudioFileHandler::done | ( | Handle * | ) |
Tells the handler, that a given file handle can be deleted.
After calling this function, you should not use this handle any more.
|
static |
Gets information about a given audio file.
| filename | The name of the audio file. |
| info | The information structure, that will be filled with relevant information |
|
inlinestatic |
Returns the first AudioFileHandler instance.
This function is not thread-safe.
| Handle* Resonant::AudioFileHandler::readFile | ( | const char * | filename, |
| long | startFrame, | ||
| Radiant::AudioSampleFormat | userFormat = Radiant::ASF_FLOAT32 |
||
| ) |
Starts the reading process for a given file.
| filename | The name of the file to read |
| startFrame | The initial frame for reading. This value is usually zero, for reading from the beginning of the file. |
| userFormat | The sample format the user of the handle is going to use. |
| Handle* Resonant::AudioFileHandler::writeFile | ( | const char * | filename, |
| int | channels, | ||
| int | samplerate, | ||
| int | sfFormat, | ||
| Radiant::AudioSampleFormat | userFormat = Radiant::ASF_FLOAT32 |
||
| ) |
Starts the writing process for a file.
| filename | The name of the audio file |
| channels | The number of audio channels in the file. |
| samplerate | The sampling rate of the audio file, typically 44100, 48000 etc. |
| sfFormat | The format of the sound file. The format is created by combining libsndfile sample type with lbsndfile file type. For example SF_FORMAT_WAV | SF_FORMAT_PCM_24 will give file in wav format, with 24-bits per sample. |
| userFormat | The sample format the user of the handle is going to use. |