Class AudioStream

Class Documentation

class AudioStream

Public Types

using InputCallback = std::function<bool(const char*, unsigned long, PaSampleFormat)>
using OutputCallback = std::function<bool(char*, unsigned long, PaSampleFormat)>

Public Functions

AudioStream()
~AudioStream()
void open(int inputDeviceIndex = -1, int outputDeviceIndex = -1, double sampleRate = 0, PaSampleFormat format = paFloat32, int inputChannels = 0, int outputChannels = 0, unsigned long framesPerBuffer = paFramesPerBufferUnspecified, bool enableInput = true, bool enableOutput = true, PaStreamFlags streamFlags = paNoFlag, InputCallback inputCallback = nullptr, OutputCallback outputCallback = nullptr)
void start()
void stop()
void close()
std::vector<AudioDeviceInfo> getInputDevices()
std::vector<AudioDeviceInfo> getOutputDevices()
AudioDeviceInfo getDefaultInputDevice()
AudioDeviceInfo getDefaultOutputDevice()
int getDeviceCount()
AudioDeviceInfo getDeviceInfoByIndex(int index)
long readStream(uint8_t *buffer, unsigned long frames)
long writeStream(const uint8_t *buffer, unsigned long frames)
long getStreamReadAvailable()
long getStreamWriteAvailable()

Public Members

int outputChannels
int inputChannels
PaSampleFormat streamFormat