mutterkey
KDE-first push-to-talk transcription tool for KDE Plasma
Loading...
Searching...
No Matches
AudioRecorder Class Referencefinal

Captures microphone audio into a Recording value object. More...

#include <audiorecorder.h>

Public Member Functions

 AudioRecorder (AudioConfig config, QObject *parent=nullptr)
 Creates a recorder with a fixed audio configuration snapshot.
 
bool start (QString *errorMessage=nullptr)
 Starts audio capture on the resolved input device.
 
Recording stop ()
 Stops capture and returns the recorded payload and format metadata.
 
bool isRecording () const
 Reports whether microphone capture is currently active.
 

Detailed Description

Captures microphone audio into a Recording value object.

The recorder owns the active QAudioSource while recording. The returned Recording preserves the device-selected format so later normalization can convert it into Whisper's required mono 16 kHz float input.

Definition at line 87 of file audiorecorder.h.

Constructor & Destructor Documentation

◆ AudioRecorder()

AudioRecorder::AudioRecorder ( AudioConfig  config,
QObject *  parent = nullptr 
)
explicit

Creates a recorder with a fixed audio configuration snapshot.

Parameters
configAudio capture preferences copied into the recorder.
parentOptional QObject parent.

Member Function Documentation

◆ isRecording()

bool AudioRecorder::isRecording ( ) const

Reports whether microphone capture is currently active.

Returns
true when a QAudioSource is running.

◆ start()

bool AudioRecorder::start ( QString *  errorMessage = nullptr)

Starts audio capture on the resolved input device.

Parameters
errorMessageOptional output for startup failures.
Returns
true when capture started successfully.

◆ stop()

Recording AudioRecorder::stop ( )

Stops capture and returns the recorded payload and format metadata.

Returns
Captured recording. Invalid when capture was not active or failed.

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