QAudioProbe

The QAudioProbe class allows you to monitor audio being played or recorded. More

Inheritance diagram of PySide2.QtMultimedia.QAudioProbe

Synopsis

Functions

Signals

Detailed Description

QAudioRecorder *recorder = new QAudioRecorder();
QAudioProbe *probe = new QAudioProbe;

// ... configure the audio recorder (skipped)

connect(probe, SIGNAL(audioBufferProbed(QAudioBuffer)), this, SLOT(processBuffer(QAudioBuffer)));

probe->setSource(recorder); // Returns true, hopefully.

recorder->record(); // Now we can do things like calculating levels or performing an FFT
class PySide2.QtMultimedia.QAudioProbe([parent=None])
param parent:

PySide2.QtCore.QObject

Creates a new QAudioProbe class with a parent . After setting the source to monitor with setSource() , the audioBufferProbed() signal will be emitted when audio buffers are flowing in the source media object.

PySide2.QtMultimedia.QAudioProbe.audioBufferProbed(buffer)
Parameters:

bufferPySide2.QtMultimedia.QAudioBuffer

PySide2.QtMultimedia.QAudioProbe.flush()
PySide2.QtMultimedia.QAudioProbe.isActive()
Return type:

bool

Returns true if this probe is monitoring something, or false otherwise.

The source being monitored does not need to be active.

PySide2.QtMultimedia.QAudioProbe.setSource(source)
Parameters:

sourcePySide2.QtMultimedia.QMediaObject

Return type:

bool

Sets the media object to monitor to source .

If source is zero, this probe will be deactivated and this function wil return true.

If the media object does not support monitoring audio, this function will return false.

The previous object will no longer be monitored. Passing in the same object will be ignored, but monitoring will continue.

PySide2.QtMultimedia.QAudioProbe.setSource(source)
Parameters:

sourcePySide2.QtMultimedia.QMediaRecorder

Return type:

bool

Starts monitoring the given mediaRecorder .

Returns true on success.

If there is no mediaObject associated with mediaRecorder , or if it is zero, this probe will be deactivated and this function wil return true.

If the media recorder instance does not support monitoring audio, this function will return false.

Any previously monitored objects will no longer be monitored. Passing in the same (valid) object will be ignored, but monitoring will continue.