QAudioRecorder Class
The QAudioRecorder class is used for the recording of audio. More...
Header: | #include <QAudioRecorder> |
qmake: | QT += multimedia |
Inherits: | QMediaRecorder |
Properties
- audioInput : QString
- 9 properties inherited from QMediaRecorder
- 1 property inherited from QObject
Public Functions
QAudioRecorder(QObject *parent = nullptr) | |
virtual | ~QAudioRecorder() |
QString | audioInput() const |
QString | audioInputDescription(const QString &name) const |
QStringList | audioInputs() const |
QString | defaultAudioInput() const |
- 34 public functions inherited from QMediaRecorder
- 30 public functions inherited from QObject
- 1 public function inherited from QMediaBindableInterface
Public Slots
void | setAudioInput(const QString &name) |
- 5 public slots inherited from QMediaRecorder
- 1 public slot inherited from QObject
Signals
void | audioInputChanged(const QString &name) |
void | availableAudioInputsChanged() |
- 13 signals inherited from QMediaRecorder
- 2 signals inherited from QObject
Related Non-Members
typedef | QObjectList |
QList<T> | qFindChildren(const QObject *obj, const QRegExp ®Exp) |
T | qobject_cast(QObject *object) |
T | qobject_cast(const QObject *object) |
Macros
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
Q_CLASSINFO(Name, Value, ) | |
Q_DISABLE_COPY(Class, ) | |
Q_DISABLE_COPY_MOVE(Class, ) | |
Q_DISABLE_MOVE(Class, ) | |
Q_EMIT | |
Q_ENUM(..., ) | |
Q_ENUM_NS(..., ) | |
Q_FLAG(..., ) | |
Q_FLAG_NS(..., ) | |
Q_GADGET | |
Q_INTERFACES(..., ) | |
Q_INVOKABLE | |
Q_NAMESPACE | |
Q_OBJECT | |
Q_PROPERTY(..., ) | |
Q_REVISION | |
Q_SET_OBJECT_NAME(Object, ) | |
Q_SIGNAL | |
Q_SIGNALS | |
Q_SLOT | |
Q_SLOTS |
Additional Inherited Members
- 9 static public members inherited from QObject
- 9 protected functions inherited from QObject
- 1 protected function inherited from QMediaBindableInterface
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.
QStringList inputs = audioRecorder->audioInputs(); QString selectedInput = audioRecorder->defaultAudioInput(); foreach (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 QMediaRecorder and QAudioInputSelectorControl.
Property Documentation
Property Documentation
audioInput : QString
This property holds the active audio input name.
Access functions:
QString | audioInput() const |
void | setAudioInput(const QString &name) |
Notifier signal:
void | audioInputChanged(const QString &name) |
Member Function Documentation
Member Function Documentation
QAudioRecorder::QAudioRecorder(QObject *parent = nullptr)
Constructs an audio recorder. The parent is passed to QMediaObject.
[signal]
void QAudioRecorder::audioInputChanged(const QString &name)
Signal emitted when active audio input changes to name.
Note: Notifier signal for property audioInput.
[signal]
void QAudioRecorder::availableAudioInputsChanged()
Signal is emitted when the available audio inputs change.
[slot]
void QAudioRecorder::setAudioInput(const QString &name)
Set the active audio input to name.
Note: Setter function for property audioInput.
See also audioInput().
[virtual]
QAudioRecorder::~QAudioRecorder()
Destroys an audio recorder object.
QString QAudioRecorder::audioInput() const
Returns the active audio input name.
Note: Getter function for property audioInput.
See also setAudioInput().
QString QAudioRecorder::audioInputDescription(const QString &name) const
Returns the readable translated description of the audio input device with name.
QStringList QAudioRecorder::audioInputs() const
Returns a list of available audio inputs
QString QAudioRecorder::defaultAudioInput() const
Returns the default audio input name.
© 2019 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.