8#include <QElapsedTimer>
23 const QAudioFormat &preferredFormat,
24 bool requestedFormatSupported,
25 QString *errorMessage =
nullptr);
65 qint64
readData(
char *data, qint64 maxSize) override;
73 qint64
writeData(const
char *data, qint64 maxSize) override;
107 bool start(QString *errorMessage =
nullptr);
119 [[nodiscard]]
bool isRecording() const;
126 [[nodiscard]] QAudioDevice resolveDevice() const;
134 QAudioFormat resolveFormat(const QAudioDevice &device, QString *errorMessage) const;
141 QAudioSource *m_audioSource =
nullptr;
143 QAudioFormat m_activeFormat;
145 QElapsedTimer m_elapsed;
QAudioFormat resolveRecordingFormatForConfig(const AudioConfig &config, const QAudioFormat &preferredFormat, bool requestedFormatSupported, QString *errorMessage=nullptr)
Resolves the active capture format from config and device capabilities.
QIODevice sink that accumulates raw captured PCM bytes in memory.
void clear()
Discards all buffered audio bytes.
AudioBufferDevice(QObject *parent=nullptr)
Creates an empty in-memory audio sink.
QByteArray takeBuffer()
Moves the buffered audio payload out of the device.
qint64 readData(char *data, qint64 maxSize) override
Audio capture is write-only for this device.
qint64 writeData(const char *data, qint64 maxSize) override
Appends captured audio bytes to the in-memory buffer.
Captures microphone audio into a Recording value object.
AudioRecorder(AudioConfig config, QObject *parent=nullptr)
Creates a recorder with a fixed audio configuration snapshot.
Runtime configuration types, defaults, and JSON loading entrypoints.
Shared recorded-audio payload passed between capture and transcription.
Audio capture configuration passed to the recorder.
Immutable-style value object holding one captured audio segment.