QAudioBufferOutput Class

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

头: #include <QAudioBufferOutput>
CMake: find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia
Since: Qt 6.8
继承: QObject

公共函数

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

信号

void audioBufferReceived (const QAudioBuffer & buffer )

详细描述

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 媒体播放器范例 .

QAudioBufferOutput is only supported with the FFmpeg backend.

另请参阅 QMediaPlayer , QMediaPlayer::setAudioBufferOutput ,和 QAudioBuffer .

成员函数文档编制

[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 .

若指定 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.