#include <audio.hh>
A module wrapper for a stereo PortAudio interface (http://www.portaudio.com/).
Use this module if you want to hear something coming from your speakers. By default it uses the computer's default audio interface (whatever is set up in the system settings). The module accumulates FRAMES_PER_BUFFER input samples into a 2D array and then waits for the audio interface to be ready to receive them. Using this module in a project thus serves as an overall clock.
[in] | left | |
[in] | right | |
[in] | aux1 | |
[in] | aux2 |
If you re lucky enough to have an audio interface for more than four channels, the names of the extra channels will continue with aux3, aux4, etc.
Public Member Functions | |
Audio (int num_output_channels=2, int num_input_channels=0) | |
void | init () |
void | update () |
![]() | |
virtual void | init ()=0 |
virtual void | update ()=0 |
int | add_input (string name) |
int | add_output (string name) |
int | get_input_index (string name) const |
string | get_input_name (int index) const |
string | get_output_name (int index) const |
int | get_output_index (string name) const |
void | set_input (string name, double value) |
void | set_input (int index, double value) |
double | get_input (int index) const |
double | get_input (string name) const |
double | get_output (string name) const |
double | get_output (int index) const |
void | set_output (int index, double value) |
void | copy_inputs (const Module &source) |
void | copy_outputs (Module &destination) const |
void | configure (std::vector< std::tuple< string, double > > assignments) |
int | num_inputs () const |
int | num_outputs () const |
void | emit (Event e) |
void | set_ts (double s) |
double | get_ts () |
|
virtual |
This method should be overridden by derived classes. It will usually be called once, after all modules and connections objects have been added to a synthesizer, but before the synthesizer starts running.
Implements yase::Module.
|
virtual |
This method should be overridden by derived classes. It will be called repeatedly by a synthesizer at a frequency determined by SAMPLE_RATE.
Implements yase::Module.