#include <taptaudio.h>
Collaboration diagram for AudioSystem:

Only one of these may exist at a time. You may delete the old copy and make a new one if you wish.
loopmix.cpp, mixing.cpp, pytests.py, record.cpp, record_basic.cpp, and volumes.cpp.
Definition at line 36 of file taptaudio.h.
Public Member Functions | |
| AudioSystem (AUDIO_FORMAT format=AF_Default, double sampleRate=0.0, int inputChannels=2, int outputChannels=2, int deviceIDin=0, int deviceIDout=0) | |
| Create the audio system. | |
| bool | freeSample (ASSample *samp) |
| Free all resources used by a sample, ONLY IF THE REFERENCE COUNT IS ZERO. | |
| bool | isRecording () |
| Returns true if we are currently recording. | |
| ASSample * | loadRawSample (const std::string &name, void *data, unsigned long size) |
| ASSample * | loadRawSample (const char *name, void *data, unsigned long size) |
| Load a raw sample from memory. | |
| ASSample * | loadSample (const std::string &name) |
| ASSample * | loadSample (const char *name) |
| Load a sample that will be managed by the AudioSystem. | |
| bool | loopSample (ASSample *samp, float vol=1.0f, unsigned *trackno=0) |
| Loop a sample. | |
| bool | mixSample (ASSample *samp, float vol=1.0f, unsigned *trackno=0) |
| bool | mixSample (ASSample *samp, bool record_after, double record_size=30.0, float vol=1.0f, unsigned *trackno=0) |
| Mix a loaded sample into the output audio stream. | |
| unsigned | setVolume (ASSample *samp, float vol=1.0f, int trackno=-1) |
| Adjust the volume of all playing instances of a sample. | |
| bool | startRec (double secondsMax=30.0) |
| Start buffering data from the audio input (microphone) into the (single) recording buffer. | |
| void | stop () |
| Stop *ALL* audio operations. | |
| ASSample * | stopRec (const std::string &name="", bool save=false, bool save_in_thread=false) |
| ASSample * | stopRec (const char *name="", bool save=false, bool save_in_thread=false) |
| Stop buffering and create a sample from the recorded audio. | |
| unsigned | stopSample (ASSample *samp, int trackno=-1) |
| Stop playing instances of a sample. | |
| ~AudioSystem () | |
| Destructor destroys the singleton, allowing another to be made. | |
Static Public Member Functions | |
| static AudioSystem * | get () |
| Get the singleton instance. | |
| static bool | isRunning () |
| Returns true if the AudioSystem is running. | |
| static void | listDevices () |
| Lists the device IDs to stderr. | |
| static void | setDebugFile (void *FILESTAR) |
| Set the FILE* at which debugging output is sent. | |
| static void | setDebugLevel (unsigned level) |
| Set the debugging level for the audio system. | |
Static Public Attributes | |
| static unsigned | AUDIO_TRACKS = 32 |
| Number of audio tracks in mixer. | |
Protected Member Functions | |
| AudioSystem (const AudioSystem &) | |
| no copying - we are a Singleton | |
| AudioSystem & | operator= (const AudioSystem &) |
| no assignment - we are a Singleton | |
Protected Attributes | |
| AudioSystemImpl * | impl |
| The pointer implementation. | |
Static Protected Attributes | |
| static AudioSystem * | instance = 0 |
| The singleton. | |
|
|
no copying - we are a Singleton
Definition at line 52 of file taptaudio.h. |
|
||||||||||||||||||||||||||||
|
Create the audio system.
Definition at line 18 of file taptaudio.cpp. References AF_Default, AF_Float32, AF_Int16, AF_Int32, AF_Int8, AudioSystemImpl::as_mutex, AUDIO_TRACKS, DODEBUG, impl, and instance. |
|
|
Destructor destroys the singleton, allowing another to be made.
Definition at line 84 of file taptaudio.cpp. References impl, instance, AudioSystemImpl::stop(), and AudioSystemImpl::waitstop(). Here is the call graph for this function: ![]() |
|
|
Free all resources used by a sample, ONLY IF THE REFERENCE COUNT IS ZERO. Will also remove itself from the sample registry. Only ever use this to free a sample -- never delete() your reference.
Definition at line 113 of file taptaudio.cpp. References AudioSystemImpl::freeSample(), and impl. Here is the call graph for this function: ![]() |
|
|
Get the singleton instance. Returns NULL if it has not been created, or it has been destroyed.
Definition at line 74 of file taptaudio.h. References instance. |
|
|
Returns true if we are currently recording.
Definition at line 129 of file taptaudio.cpp. References impl, and AudioSystemImpl::isRecording(). Here is the call graph for this function: ![]() |
|
|
Returns true if the AudioSystem is running.
Definition at line 79 of file taptaudio.h. References instance. |
|
|
Lists the device IDs to stderr.
Definition at line 166 of file taptaudio.cpp. References AudioSystemImpl::listDevices(). Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Load a raw sample from memory. Must match the format of the loaded AudioSystem. Definition at line 150 of file taptaudio.cpp. |
|
|
Load a sample that will be managed by the AudioSystem. Client code will just use the return value as a pointer to pass back into the audio system. Most of this can occur in a background thread .. but maybe not two at once.
Definition at line 146 of file taptaudio.cpp. |
|
||||||||||||||||
|
Loop a sample. Stop it with stopSample.
Definition at line 109 of file taptaudio.cpp. References impl, and AudioSystemImpl::loopSample(). Here is the call graph for this function: ![]() |
|
||||||||||||||||||||||||
|
Mix a loaded sample into the output audio stream.
Definition at line 101 of file taptaudio.cpp. References impl, and AudioSystemImpl::mixSample(). Here is the call graph for this function: ![]() |
|
|
no assignment - we are a Singleton
Definition at line 54 of file taptaudio.h. |
|
|
Set the FILE* at which debugging output is sent.
Definition at line 162 of file taptaudio.cpp. References taptaudio_debug_file. |
|
|
Set the debugging level for the audio system. 0 for none, higher means more messages Definition at line 158 of file taptaudio.cpp. References SETDEBUG. |
|
||||||||||||||||
|
Adjust the volume of all playing instances of a sample.
Definition at line 133 of file taptaudio.cpp. References impl, and AudioSystemImpl::setVolume(). Here is the call graph for this function: ![]() |
|
|
Start buffering data from the audio input (microphone) into the (single) recording buffer.
Definition at line 121 of file taptaudio.cpp. References impl, and AudioSystemImpl::startRec(). Here is the call graph for this function: ![]() |
|
|
Stop *ALL* audio operations.
Definition at line 137 of file taptaudio.cpp. References impl, and AudioSystemImpl::stop(). Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Stop buffering and create a sample from the recorded audio.
Definition at line 154 of file taptaudio.cpp. |
|
||||||||||||
|
Stop playing instances of a sample.
Definition at line 117 of file taptaudio.cpp. References impl, and AudioSystemImpl::stopSample(). Here is the call graph for this function: ![]() |
|
|
Number of audio tracks in mixer.
Definition at line 142 of file taptaudio.cpp. Referenced by AudioSystem(). |
|
|
The pointer implementation.
Definition at line 56 of file taptaudio.h. Referenced by AudioSystem(), freeSample(), isRecording(), loadRawSample(), loadSample(), loopSample(), mixSample(), setVolume(), startRec(), stop(), stopRec(), stopSample(), and ~AudioSystem(). |
|
|
The singleton.
Definition at line 143 of file taptaudio.cpp. Referenced by AudioSystem(), get(), isRunning(), and ~AudioSystem(). |
1.4.3