QAudioRecorder¶
The
QAudioRecorder
class is used for the recording of audio. More…
Synopsis¶
Functions¶
def
audioInput
()def
audioInputDescription
(name)def
audioInputs
()def
defaultAudioInput
()
Slots¶
def
setAudioInput
(name)
Signals¶
def
audioInputChanged
(name)def
availableAudioInputsChanged
()
Detailed Description¶
The
QAudioRecorder
class is a high level media recording class and contains the same functionality asQMediaRecorder
.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.
See also
- class PySide2.QtMultimedia.QAudioRecorder([parent=None])¶
- param parent:
Constructs an audio recorder. The
parent
is passed toQMediaObject
.
- 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..
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.