W3cubDocs

/Qt

QPlatformAudioSource Class

The QPlatformAudioSource class provides access for QAudioSource to access the audio device provided by the plugin. More...

Header: #include <QPlatformAudioSource>
CMake: find_package(Qt6 COMPONENTS Multimedia REQUIRED) target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia
Inherits: QObject

Public Functions

virtual qsizetype bufferSize() const = 0
virtual qsizetype bytesReady() const = 0
virtual QAudio::Error error() const = 0
virtual QAudioFormat format() const = 0
virtual qint64 processedUSecs() const = 0
virtual void reset() = 0
virtual void resume() = 0
virtual void setBufferSize(qsizetype value) = 0
virtual void setFormat(const QAudioFormat &fmt) = 0
virtual void start(QIODevice *device) = 0
virtual QIODevice * start() = 0
virtual QAudio::State state() const = 0
virtual void stop() = 0
virtual void suspend() = 0

Signals

void errorChanged(QAudio::Error error)
void stateChanged(QAudio::State state)

Detailed Description

QAudioDeviceInput keeps an instance of QPlatformAudioSource and routes calls to functions of the same name to QPlatformAudioSource. This means that it is QPlatformAudioSource that implements the audio functionality. For a description of the functionality, see the QAudioSource class description.

See also QAudioSource.

Member Function Documentation

[signal] void QPlatformAudioSource::errorChanged(QAudio::Error error)

This signal is emitted when the error state has changed.

[signal] void QPlatformAudioSource::stateChanged(QAudio::State state)

This signal is emitted when the device state has changed.

[pure virtual] qsizetype QPlatformAudioSource::bufferSize() const

Returns the audio buffer size in milliseconds.

See also setBufferSize().

[pure virtual] qsizetype QPlatformAudioSource::bytesReady() const

Returns the amount of audio data available to read in bytes.

[pure virtual] QAudio::Error QPlatformAudioSource::error() const

Returns the error state.

[pure virtual] QAudioFormat QPlatformAudioSource::format() const

Returns the QAudioFormat being used

See also setFormat().

[pure virtual] qint64 QPlatformAudioSource::processedUSecs() const

Returns the amount of audio data processed since start() was called in milliseconds.

[pure virtual] void QPlatformAudioSource::reset()

Drops all audio data in the buffers, resets buffers to zero.

[pure virtual] void QPlatformAudioSource::resume()

Resumes processing audio data after a suspend().

[pure virtual] void QPlatformAudioSource::setBufferSize(qsizetype value)

Sets the audio buffer size to value in milliseconds.

See also bufferSize().

[pure virtual] void QPlatformAudioSource::setFormat(const QAudioFormat &fmt)

Set the QAudioFormat to use to fmt. Setting the format is only allowable while in QAudio::StoppedState.

See also format().

[pure virtual] void QPlatformAudioSource::start(QIODevice *device)

Uses the device as the QIODevice to transfer data.

[pure virtual] QIODevice *QPlatformAudioSource::start()

Returns a pointer to the QIODevice being used to handle the data transfer. This QIODevice can be used to read() audio data directly.

[pure virtual] QAudio::State QPlatformAudioSource::state() const

Returns the state of audio processing.

[pure virtual] void QPlatformAudioSource::stop()

Stops the audio input.

[pure virtual] void QPlatformAudioSource::suspend()

Stops processing audio data, preserving buffered audio data.

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.2/qplatformaudiosource.html