HulaLoop
Simple cross-platform audio loopback and recording.
Public Member Functions | List of all members
hula::WindowsAudio Class Reference

A audio class that captures system wide audio on Windows. More...

#include <WindowsAudio.h>

Inheritance diagram for hula::WindowsAudio:
Inheritance graph
[legend]
Collaboration diagram for hula::WindowsAudio:
Collaboration graph
[legend]

Public Member Functions

 ~WindowsAudio ()
 Clear all global pointers.
 
bool checkDeviceParams (Device *device)
 Checks the sampling rate and bit depth of the device. More...
 
std::vector< Device * > getDevices (DeviceType type)
 Receive the list of available record, playback and/or loopback audio devices connected to the OS and return them as Device instances. More...
 
void capture ()
 Execution loop for loopback capture.
 
- Public Member Functions inherited from hula::OSAudio
virtual ~OSAudio ()=0
 Virtual implementation of Destructor.
 
void setBufferSize (uint32_t size)
 Set the desired capture buffer size. More...
 
void addBuffer (HulaRingBuffer *rb)
 Add an initialized buffer to the list of buffers that receive audio data. More...
 
void removeBuffer (HulaRingBuffer *rb)
 Remove a buffer from the list of buffers that receive audio data. More...
 
void copyToBuffers (const void *data, uint32_t bytes)
 Write to each of the buffers contained in rbs.
 
virtual bool setActiveInputDevice (Device *device)
 Set the selected input device and restart capture threads with new device. More...
 
virtual bool setActiveOutputDevice (Device *device)
 Set the selected output device and restart capture threads with new device. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from hula::OSAudio
static void backgroundCapture (OSAudio *_this)
 Static function to allow starting a thread with an instance's capture method. More...
 
- Protected Member Functions inherited from hula::OSAudio
 OSAudio ()
 Constructor is protected since this class is abstract.
 
- Protected Attributes inherited from hula::OSAudio
DeviceactiveInputDevice
 The selected input device.
 
DeviceactiveOutputDevice
 The selected output device.
 
std::vector< HulaRingBuffer * > rbs
 List of all added ring buffers. More...
 
std::vector< std::thread > inThreads
 Thread for input device activities.
 
std::vector< std::thread > outThreads
 Thread for output device activities.
 
std::atomic< bool > endCapture
 Flag to syncronize the capture thread for an instance. More...
 
uint32_t captureBufferSize
 I don't really know what this is for right now but I'm going to add this comment so that Doxygen will quit complaining. More...
 

Detailed Description

A audio class that captures system wide audio on Windows.

Member Function Documentation

bool WindowsAudio::checkDeviceParams ( Device activeDevice)
virtual

Checks the sampling rate and bit depth of the device.

Parameters
deviceInstance of Device that corresponds to the desired system device

Implements hula::OSAudio.

std::vector< Device * > WindowsAudio::getDevices ( DeviceType  type)
virtual

Receive the list of available record, playback and/or loopback audio devices connected to the OS and return them as Device instances.

Parameters
typeDeviceType that is combination from the DeviceType enum
Returns
std::vector<Device*> A list of Device instances that carry the necessary device information

Implements hula::OSAudio.


The documentation for this class was generated from the following files: