SoDaRadio-12.2.0-cut_dependencies:6c82803
Loading...
Searching...
No Matches
SoDaCLI::AudioToneThread Class Reference

Generates a 440 Hz sine wave and plays it through an audio output device. More...

#include <CLIAudio.hxx>

Inheritance diagram for SoDaCLI::AudioToneThread:

Public Member Functions

 AudioToneThread (const QAudioDevice &dev, QObject *parent=nullptr)
 ~AudioToneThread ()
void stopAudio ()
 Stop the thread cleanly.

Protected Member Functions

void run () override

Private Attributes

QAudioDevice device
std::atomic< bool > stop_flag

Detailed Description

Generates a 440 Hz sine wave and plays it through an audio output device.

Used to verify that audio output is working independently of SoDaServer. Call start() to begin playback; call stopAudio() to stop. Volume is fixed at 0.2 (20 % full scale).

Definition at line 193 of file CLIAudio.hxx.

Constructor & Destructor Documentation

◆ AudioToneThread()

SoDaCLI::AudioToneThread::AudioToneThread ( const QAudioDevice & dev,
QObject * parent = nullptr )
explicit
Parameters
devAudio output device.
parentOptional Qt parent.

◆ ~AudioToneThread()

SoDaCLI::AudioToneThread::~AudioToneThread ( )

Member Function Documentation

◆ run()

void SoDaCLI::AudioToneThread::run ( )
overrideprotected

◆ stopAudio()

void SoDaCLI::AudioToneThread::stopAudio ( )

Stop the thread cleanly.

Member Data Documentation

◆ device

QAudioDevice SoDaCLI::AudioToneThread::device
private

Definition at line 211 of file CLIAudio.hxx.

◆ stop_flag

std::atomic<bool> SoDaCLI::AudioToneThread::stop_flag
private

Definition at line 212 of file CLIAudio.hxx.


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