QAudioRecorder

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

Inheritance diagram of PySide2.QtMultimedia.QAudioRecorder

Synopsis

Functions

Slots

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 QAudioRecorder([parent=None])
param parent

QObject

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

PySide2.QtMultimedia.QAudioRecorder.audioInput()
Return type

unicode

Returns the active audio input name.

See also

setAudioInput()

PySide2.QtMultimedia.QAudioRecorder.audioInputChanged(name)
Parameters

name – unicode

PySide2.QtMultimedia.QAudioRecorder.audioInputDescription(name)
Parameters

name – unicode

Return type

unicode

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

unicode

Returns the default audio input name.

PySide2.QtMultimedia.QAudioRecorder.setAudioInput(name)
Parameters

name – unicode

Set the active audio input to name .

See also

audioInput()