![]() |
SoDaRadio-12.2.0-cut_dependencies:6c82803
|
Generic Audio Interface Class. More...
#include <AudioIfc.hxx>
Public Member Functions | |
| virtual int | send (void *buf, unsigned int len, bool when_ready=false)=0 |
| send – send a buffer to the audio output | |
| virtual bool | sendBufferReady (unsigned int len)=0 |
| sendBufferReady – is there enough space in the audio device send buffer for a call from send? | |
| virtual int | recv (std::vector< float > &buf, bool when_ready=false)=0 |
| recv – get a buffer of data from the audio input | |
| virtual bool | recvBufferReady (unsigned int len)=0 |
| recvBufferReady – is there enough space in the audio device recv buffer for a call from recv? | |
| virtual bool | setOutGain (float gain) |
| set the gain for the output device. | |
| virtual bool | setInGain (float gain) |
| set the gain for the input device. | |
| virtual float | getOutGain () |
| get the gain for the output device. | |
| virtual float | getInGain () |
| get the gain for the input device. | |
| virtual void | sleepOut ()=0 |
| stop the output stream so that we don't encounter a buffer underflow while the reciever is muted. | |
| virtual void | wakeOut ()=0 |
| start the output stream | |
| virtual void | sleepIn ()=0 |
| stop the input stream so that we don't encounter a buffer overflow while the transmitter is inactive. | |
| virtual void | wakeIn ()=0 |
| start the input stream | |
| virtual std::string | currentPlaybackState () |
| virtual std::string | currentCaptureState () |
Protected Member Functions | |
| AudioIfc (unsigned int _sample_rate, unsigned int _sample_count_hint, const std::string &name="AudioIfc") | |
Protected Attributes | |
| unsigned int | sample_rate |
| unsigned int | sample_count_hint |
| float | in_gain |
| float | out_gain |
| int | datatype_size |
Generic Audio Interface Class.
This is a pure virtual class that is the interface spec for whatever actual audio interface is provided. The spec is suitable for implementations using ALSA, PA, or Qt via IP link.
Formerly, SoDaRadio used PortAudio, but this proved problematic. As of some version prior to 7.0, RX audio is passed through the unix domain socket interface to the Qt GUI, and TX audio is captured from an AudioALSA object.
Definition at line 51 of file AudioIfc.hxx.
|
inlineprotected |
Definition at line 59 of file AudioIfc.hxx.
References datatype_size, sample_count_hint, and sample_rate.
|
inlinevirtual |
Reimplemented in SoDa::AudioQt.
Definition at line 161 of file AudioIfc.hxx.
|
inlinevirtual |
Reimplemented in SoDa::AudioQt.
Definition at line 160 of file AudioIfc.hxx.
|
inlinevirtual |
get the gain for the input device.
Definition at line 136 of file AudioIfc.hxx.
References in_gain.
|
inlinevirtual |
get the gain for the output device.
Definition at line 130 of file AudioIfc.hxx.
References out_gain.
|
pure virtual |
recv – get a buffer of data from the audio input
| buf | vector of float samples from the audio input device |
| when_ready | if true, test with recvBufferReady and return 0 if not ready otherwise perform the recv regardless. |
Implemented in SoDa::AudioQt.
|
pure virtual |
recvBufferReady – is there enough space in the audio device recv buffer for a call from recv?
| len | the number of samples that we wish to get |
Implemented in SoDa::AudioQt.
|
pure virtual |
send – send a buffer to the audio output
| buf | buffer of type described by the DataFormat selected at init |
| len | number of elements in the buffer to send |
| when_ready | if true, test with sendBufferReady and return 0 if not ready otherwise perform the send regardless. |
Implemented in SoDa::AudioQt.
|
pure virtual |
sendBufferReady – is there enough space in the audio device send buffer for a call from send?
| len | the number of samples that we wish to send |
Implemented in SoDa::AudioQt.
|
inlinevirtual |
set the gain for the input device.
| gain | – range from 0 to 1.0 |
Definition at line 121 of file AudioIfc.hxx.
References in_gain.
|
inlinevirtual |
set the gain for the output device.
| gain | – range from 0 to 1.0 |
Definition at line 111 of file AudioIfc.hxx.
References out_gain.
|
pure virtual |
stop the input stream so that we don't encounter a buffer overflow while the transmitter is inactive.
This should also flush all incoming buffers. (Virtual audio devices can get ahead of the processing by a good bit.)
Implemented in SoDa::AudioQt.
|
pure virtual |
stop the output stream so that we don't encounter a buffer underflow while the reciever is muted.
Implemented in SoDa::AudioQt.
|
pure virtual |
start the input stream
Implemented in SoDa::AudioQt.
|
pure virtual |
start the output stream
Implemented in SoDa::AudioQt.
|
protected |
Definition at line 170 of file AudioIfc.hxx.
Referenced by AudioIfc().
|
protected |
Definition at line 167 of file AudioIfc.hxx.
Referenced by getInGain(), and setInGain().
|
protected |
Definition at line 168 of file AudioIfc.hxx.
Referenced by getOutGain(), and setOutGain().
|
protected |
Definition at line 165 of file AudioIfc.hxx.
Referenced by AudioIfc().
|
protected |
Definition at line 164 of file AudioIfc.hxx.
Referenced by AudioIfc().