![]() |
SoDaRadio-12.2.0-cut_dependencies:6c82803
|
Captures microphone audio and sends it to SoDaServer. More...
#include <CLIAudio.hxx>
Public Member Functions | |
| AudioInThread (const std::string &sockPath, const QAudioDevice &dev, float initGain=0.0f, QObject *parent=nullptr) | |
| ~AudioInThread () | |
| void | setGain (float g) |
| Set capture gain (thread-safe). | |
| void | stopAudio () |
| Stop the thread cleanly. | |
Protected Member Functions | |
| void | run () override |
Private Attributes | |
| std::string | sock_path |
| QAudioDevice | device |
| std::atomic< float > | pending_gain |
| std::atomic< bool > | stop_flag |
Captures microphone audio and sends it to SoDaServer.
Connects as a QLocalSocket client to sockPath (the server's _txa socket). Samples captured from a QAudioSource are scaled by the current gain and forwarded to the socket.
Create, call start(), then use setGain() to enable audio.
Definition at line 147 of file CLIAudio.hxx.
|
explicit |
| sockPath | Full path of the _txa socket. |
| dev | Audio input device. |
| initGain | Initial gain [0.0 = muted, 1.0 = unity]. |
| parent | Optional Qt parent. |
| SoDaCLI::AudioInThread::~AudioInThread | ( | ) |
|
overrideprotected |
|
inline |
Set capture gain (thread-safe).
| g | Linear gain factor applied to each sample. |
Definition at line 166 of file CLIAudio.hxx.
References pending_gain.
| void SoDaCLI::AudioInThread::stopAudio | ( | ) |
Stop the thread cleanly.
|
private |
Definition at line 178 of file CLIAudio.hxx.
|
private |
Definition at line 179 of file CLIAudio.hxx.
Referenced by setGain().
|
private |
Definition at line 177 of file CLIAudio.hxx.
|
private |
Definition at line 180 of file CLIAudio.hxx.