Audacity 3.2.0
Classes | Namespaces | Typedefs | Enumerations | Functions
AudioIO.h File Reference
#include "AudioIOBase.h"
#include "PlaybackSchedule.h"
#include <functional>
#include <memory>
#include <mutex>
#include <thread>
#include <utility>
#include <wx/atomic.h>
#include "PluginProvider.h"
#include "Observer.h"
#include "SampleCount.h"
#include "SampleFormat.h"
Include dependency graph for AudioIO.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  AudioIOEvent
struct  TransportTracks
class  AudioIoCallback
 AudioIoCallback is a class that implements the callback required by PortAudio. The callback needs to be responsive, has no GUI, and copies data into and out of the sound card buffers. It also sends data to the meters. More...
class  AudioIoCallback::AudioIOExtIterator
struct  AudioIoCallback::AudioIOExtRange
class  AudioIO
 AudioIO uses the PortAudio library to play and record sound. More...


namespace  RealtimeEffects


using PlayableTrackConstArray = std::vector< std::shared_ptr< const PlayableTrack > >
using WaveTrackArray = std::vector< std::shared_ptr< WaveTrack > >
using WaveTrackConstArray = std::vector< std::shared_ptr< const WaveTrack > >
typedef unsigned long PaStreamCallbackFlags
typedef int PaError


enum class  Acknowledge { eNone = 0 , eStart , eStop }


bool ValidateDeviceNames ()
int audacityAudioCallback (const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData)

Typedef Documentation

◆ PaError

typedef int PaError

Definition at line 54 of file AudioIO.h.

◆ PaStreamCallbackFlags

typedef unsigned long PaStreamCallbackFlags

Definition at line 53 of file AudioIO.h.

◆ PlayableTrackConstArray

using PlayableTrackConstArray = std::vector < std::shared_ptr < const PlayableTrack > >

Definition at line 44 of file AudioIO.h.

◆ WaveTrackArray

using WaveTrackArray = std::vector < std::shared_ptr < WaveTrack > >

Definition at line 49 of file AudioIO.h.

◆ WaveTrackConstArray

using WaveTrackConstArray = std::vector < std::shared_ptr < const WaveTrack > >

Definition at line 50 of file AudioIO.h.

Enumeration Type Documentation

◆ Acknowledge

enum class Acknowledge

Definition at line 62 of file AudioIO.h.

Function Documentation

◆ audacityAudioCallback()

int audacityAudioCallback ( const void *  inputBuffer,
void *  outputBuffer,
unsigned long  framesPerBuffer,
const PaStreamCallbackTimeInfo *  timeInfo,
PaStreamCallbackFlags  statusFlags,
void *  userData 

brief The function which is called from PortAudio's callback thread context to collect and deliver audio for / from the sound device.

This covers recording, playback, and doing both simultaneously. It is also invoked to do monitoring and software playthrough. Note that dealing with the two buffers needs some care to ensure that the right things happen for all possible cases.

inputBufferBuffer of length framesPerBuffer containing samples from the sound card, or null if not capturing audio. Note that the data type will depend on the format of audio data that was chosen when the stream was created (so could be floats or various integers)
outputBufferUninitialised buffer of length framesPerBuffer which will be sent to the sound card after the callback, or null if not playing audio back.
framesPerBufferThe length of the playback and recording buffers
PaStreamCallbackTimeInfoPointer to PortAudio time information structure, which tells us how long we have been playing / recording
statusFlagsPortAudio stream status flags
userDatapointer to user-defined data structure. Provided for flexibility by PortAudio, but not used by Audacity - the data is stored in the AudioIO class instead.

Definition at line 2394 of file AudioIO.cpp.

2399 auto gAudioIO = AudioIO::Get();
2400 return gAudioIO->AudioCallback(
2401 static_cast<constSamplePtr>(inputBuffer),
2402 static_cast<float*>(outputBuffer), framesPerBuffer,
2403 timeInfo, statusFlags, userData);
const char * constSamplePtr
Definition: SampleFormat.h:50
static AudioIO * Get()
Definition: AudioIO.cpp:133

References AudioIO::Get().

Referenced by AudioIO::StartPortAudioStream().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ValidateDeviceNames()

bool ValidateDeviceNames ( )