#include <audio/service/audioservice.h>
Public Member Functions | |
AudioService (ServiceConfiguration *configuration) | |
~AudioService ()=default | |
bool | init (nap::utility::ErrorState &errorState) override |
void | shutdown () override |
NodeManager & | getNodeManager () |
void | onAudioCallback (float **inputBuffer, float **outputBuffer, unsigned long framesPerBuffer) |
void | enqueueTask (TaskQueue::Task task) |
![]() | |
UNPREFIXED_MODULE_NAME_INPUTCASE | Service (ServiceConfiguration *configuration) |
virtual void | getDependentServices (std::vector< rtti::TypeInfo > &dependencies) override |
virtual void | update (double deltaTime) override |
Service (ServiceConfiguration *configuration) | |
virtual | ~Service () |
Core & | getCore () |
const Core & | getCore () const |
std::string | getTypeName () const |
const Module & | getModule () const |
Service (Service &)=delete | |
Service & | operator= (const Service &)=delete |
Service (Service &&)=delete | |
Service & | operator= (Service &&)=delete |
Additional Inherited Members | |
![]() | |
virtual void | registerObjectCreators (rtti::Factory &factory) |
virtual void | getDependentServices (std::vector< rtti::TypeInfo > &dependencies) |
virtual void | created () |
virtual void | preUpdate (double deltaTime) |
virtual void | update (double deltaTime) |
virtual void | postUpdate (double deltaTime) |
virtual void | preShutdown () |
virtual void | preResourcesLoaded () |
virtual void | postResourcesLoaded () |
template<typename SERVICE_CONFIG > | |
SERVICE_CONFIG * | getConfiguration () |
template<typename SERVICE_CONFIG > | |
const SERVICE_CONFIG * | getConfiguration () const |
std::string | getIniFilePath () const |
std::string | getIniFilePath (const std::string &appendix) const |
Service that provides audio input and output processing directly for hardware audio devices. Provides static methods to poll the current system for available audio devices using portaudio.
AudioService | ( | ServiceConfiguration * | configuration | ) |
|
default |
void enqueueTask | ( | TaskQueue::Task | task | ) |
Enqueue a task to be executed within the process() method for thread safety
NodeManager& getNodeManager | ( | ) |
|
overridevirtual |
Initializes portaudio.
Reimplemented from Service.
void onAudioCallback | ( | float ** | inputBuffer, |
float ** | outputBuffer, | ||
unsigned long | framesPerBuffer | ||
) |
This function is typically called by a hardware callback from the device to perform all the audio processing. It performs memory management and processes a lockfree event queue before it invokes the NodeManager::process() to process audio.
inputBuffer | an array of float arrays, representing one sample buffer for every channel |
outputBuffer | an array of float arrays, representing one sample buffer for every channel |
framesPerBuffer | the number of samples that has to be processed per channel |
|
overridevirtual |
Called on shutdown of the service. Closes portaudio stream and shuts down portaudio.
Reimplemented from Service.