- Qt 6.11
- Qt Multimedia
- C++ Classes
- QtMultimedia
- QAudioBufferOutput
- Qt 6.11.0 Reference Documentation

# QAudioBufferOutput Class

The QAudioBufferOutput class is used for capturing audio data provided by QMediaPlayer. More...

Header: | `#include <QAudioBufferOutput>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS Multimedia)` `target_link_libraries(mytarget PRIVATE Qt6::Multimedia)`
qmake: | `QT += multimedia`
Since: | Qt 6.8
Inherits: | QObject

- List of all members, including inherited members

## Public Functions

| QAudioBufferOutput(QObject *parent = nullptr)
| QAudioBufferOutput(const QAudioFormat &format, QObject *parent = nullptr)
virtual | ~QAudioBufferOutput() override
QAudioFormat | format() const

## Signals

void | audioBufferReceived(const QAudioBuffer &buffer)

## Detailed Description

QAudioBufferOutput can be set to QMediaPlayer in order to receive audio buffers decoded by the media player. The received audio data can be used for any processing or visualization. An audio level meter implementation can be seen in the widget based Media Player Example.

QAudioBufferOutput is only supported with the FFmpeg backend.

See also QMediaPlayer, QMediaPlayer::setAudioBufferOutput, and QAudioBuffer.

## Member Function Documentation

### `[explicit]` QAudioBufferOutput::QAudioBufferOutput(QObject *parent = nullptr)

Constructs a new QAudioBufferOutput object with parent.

The audio format of output audio buffers will depend on the source media file and the inner audio decoder in QMediaPlayer.

### `[explicit]` QAudioBufferOutput::QAudioBufferOutput(const QAudioFormat &format, QObject *parent = nullptr)

Constructs a new QAudioBufferOutput object with audio format and parent.

If the specified format is valid, it will be the format of output audio buffers. Otherwise, the format of output audio buffers will depend on the source media file and the inner audio decoder in QMediaPlayer.

### `[override virtual noexcept]` QAudioBufferOutput::~QAudioBufferOutput()

Destroys the audio buffer output object.

### `[signal]` void QAudioBufferOutput::audioBufferReceived(const QAudioBuffer &buffer)

Signals that a new audio buffer has been received from QMediaPlayer.

### QAudioFormat QAudioBufferOutput::format() const

Gets the audio format specified in the constructor.

If the format is valid, it specifies the format of output oudio buffers.