May 2019
Intermediate to advanced
542 pages
13h 37m
English
The audio recording in Qt is facilitated by the QAudioRecorder class. Just as the QMediaPlayer class was analogous to a media playback device, the QAudioRecorder class is analogous to a media recording device such as a digital audio recorder (or, if you're of the author's generation, a tape recorder). The recorder is controlled using the record(), stop(), and pause() methods, much like the media player object.
Let's add a recorder object to our SoundWidget, as follows:
self.recorder = qtmm.QAudioRecorder()
To control the recorder, we'll create another dual-function button class that is similar to the play button that we previously created:
class RecordButton(qtw.QPushButton): record_stylesheet = 'background-color: ...
Read now
Unlock full access