Audacity 3.2.0
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
AudioIO.h File Reference
#include "AudioIOBase.h"
#include "AudioIOSequences.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.

Classes

struct  AudioIOEvent
 
struct  TransportSequences
 
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...
 

Namespaces

namespace  RealtimeEffects
 

Typedefs

typedef unsigned long PaStreamCallbackFlags
 
typedef int PaError
 

Enumerations

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

Functions

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

Variables

AUDIO_IO_API BoolSetting SoundActivatedRecord
 

Typedef Documentation

◆ PaError

typedef int PaError

Definition at line 45 of file AudioIO.h.

◆ PaStreamCallbackFlags

typedef unsigned long PaStreamCallbackFlags

Definition at line 44 of file AudioIO.h.

Enumeration Type Documentation

◆ Acknowledge

enum class Acknowledge
strong
Enumerator
eNone 
eStart 
eStop 

Definition at line 53 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.

Parameters
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 2522 of file AudioIO.cpp.

2526{
2527 auto gAudioIO = AudioIO::Get();
2528 return gAudioIO->AudioCallback(
2529 static_cast<constSamplePtr>(inputBuffer),
2530 static_cast<float*>(outputBuffer), framesPerBuffer,
2531 timeInfo, statusFlags, userData);
2532}
const char * constSamplePtr
Definition: SampleFormat.h:58
static AudioIO * Get()
Definition: AudioIO.cpp:126

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

Variable Documentation

◆ SoundActivatedRecord

AUDIO_IO_API BoolSetting SoundActivatedRecord
extern