QAudioRecorder

The QAudioRecorder class is used for the recording of audio. More

Inheritance diagram of PySide2.QtMultimedia.QAudioRecorder

Synopsis

Functions

Slots

Signals

Detailed Description

The QAudioRecorder class is a high level media recording class and contains the same functionality as QMediaRecorder .

audioRecorder = new QAudioRecorder;

QAudioEncoderSettings audioSettings;
audioSettings.setCodec("audio/amr");
audioSettings.setQuality(QMultimedia::HighQuality);

audioRecorder->setEncodingSettings(audioSettings);

audioRecorder->setOutputLocation(QUrl::fromLocalFile("test.amr"));
audioRecorder->record();

In addition QAudioRecorder provides functionality for selecting the audio input.

const QStringList inputs = audioRecorder->audioInputs();
QString selectedInput = audioRecorder->defaultAudioInput();

for (const QString &input : inputs) {
    QString description = audioRecorder->audioInputDescription(input);
    // show descriptions to user and allow selection
    selectedInput = input;
}

audioRecorder->setAudioInput(selectedInput);

The Audio Recorder Example shows how to use this class in more detail.

class PySide2.QtMultimedia.QAudioRecorder([parent=None])
param parent:

PySide2.QtCore.QObject

Constructs an audio recorder. The parent is passed to QMediaObject .

PySide2.QtMultimedia.QAudioRecorder.audioInput()
Return type:

str

This property holds the active audio input name..

PySide2.QtMultimedia.QAudioRecorder.audioInputChanged(name)
Parameters:

name – str

PySide2.QtMultimedia.QAudioRecorder.audioInputDescription(name)
Parameters:

name – str

Return type:

str

Returns the readable translated description of the audio input device with name .

PySide2.QtMultimedia.QAudioRecorder.audioInputs()
Return type:

list of strings

Returns a list of available audio inputs

PySide2.QtMultimedia.QAudioRecorder.availableAudioInputsChanged()
PySide2.QtMultimedia.QAudioRecorder.defaultAudioInput()
Return type:

str

Returns the default audio input name.

PySide2.QtMultimedia.QAudioRecorder.setAudioInput(name)
Parameters:

name – str

This property holds the active audio input name..