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
.self.audioRecorder = QAudioRecorder() self.audioSettings = QAudioEncoderSettings() self.audioSettings.setCodec("audio/amr") self.audioSettings.setQuality(self.audioSettings.HighQuality) self.audioRecorder.setEncodingSettings(self.audioSettings) self.audioRecorder.setOutputLocation(QUrl.fromLocalFile("test.amr")) self.audioRecorder.record()In addition
QAudioRecorder
provides functionality for selecting the audio input.self.inputs = self.audioRecorder.audioInputs() self.selectedInput = self.audioRecorder.defaultAudioInputself() for audioInput in self.inputs: self.description = self.audioRecorder.audioInputDescription(audioInput) # show descriptions to user and allow selection self.selectedInput = audioInput self.audioRecorder.setAudioInput(selectedInput)The Audio Recorder Example shows how to use this class in more detail.
See also
-
class
QAudioRecorder
([parent=None])¶ - param parent
QObject
Constructs an audio recorder. The
parent
is passed toQMediaObject
.
-
PySide2.QtMultimedia.QAudioRecorder.
audioInput
()¶ - Return type
unicode
Returns the active audio input name.
See also
-
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