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

QIODevice sink that accumulates raw captured PCM bytes in memory. More...

#include <audiorecorder.h>

Public Member Functions

 AudioBufferDevice (QObject *parent=nullptr)
 Creates an empty in-memory audio sink.
 
void clear ()
 Discards all buffered audio bytes.
 
QByteArray takeBuffer ()
 Moves the buffered audio payload out of the device.
 

Protected Member Functions

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.
 

Detailed Description

QIODevice sink that accumulates raw captured PCM bytes in memory.

Definition at line 35 of file audiorecorder.h.

Constructor & Destructor Documentation

◆ AudioBufferDevice()

AudioBufferDevice::AudioBufferDevice ( QObject *  parent = nullptr)
explicit

Creates an empty in-memory audio sink.

Parameters
parentOptional QObject parent.

Member Function Documentation

◆ readData()

qint64 AudioBufferDevice::readData ( char *  data,
qint64  maxSize 
)
overrideprotected

Audio capture is write-only for this device.

Returns
Always returns -1.

◆ takeBuffer()

QByteArray AudioBufferDevice::takeBuffer ( )

Moves the buffered audio payload out of the device.

Returns
Captured PCM bytes accumulated since the last clear or take.

◆ writeData()

qint64 AudioBufferDevice::writeData ( const char *  data,
qint64  maxSize 
)
overrideprotected

Appends captured audio bytes to the in-memory buffer.

Parameters
dataSource byte range from Qt Multimedia.
maxSizeNumber of bytes available.
Returns
Number of bytes consumed.

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