1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QAUDIOBUFFERINPUT_H
5#define QAUDIOBUFFERINPUT_H
6
7#include <QtMultimedia/qtmultimediaexports.h>
8#include <QtMultimedia/qaudiobuffer.h>
9#include <QtCore/qobject.h>
10
11QT_BEGIN_NAMESPACE
12
13class QPlatformAudioBufferInput;
14class QAudioBufferInputPrivate;
15class QMediaCaptureSession;
16
17class Q_MULTIMEDIA_EXPORT QAudioBufferInput : public QObject
18{
19 Q_OBJECT
20public:
21 explicit QAudioBufferInput(QObject *parent = nullptr);
22
23 explicit QAudioBufferInput(const QAudioFormat &format, QObject *parent = nullptr);
24
25 ~QAudioBufferInput() override;
26
27 bool sendAudioBuffer(const QAudioBuffer &audioBuffer);
28
29 QAudioFormat format() const;
30
31 QMediaCaptureSession *captureSession() const;
32
33Q_SIGNALS:
34 void readyToSendAudioBuffer();
35
36private:
37 void setCaptureSession(QMediaCaptureSession *captureSession);
38
39 QPlatformAudioBufferInput *platformAudioBufferInput() const;
40
41 friend class QMediaCaptureSession;
42 Q_DISABLE_COPY(QAudioBufferInput)
43 Q_DECLARE_PRIVATE(QAudioBufferInput)
44};
45
46QT_END_NAMESPACE
47
48#endif // QAUDIOBUFFERINPUT_H
49

Provided by KDAB

Privacy Policy
Learn Advanced QML with KDAB
Find out more

source code of qtmultimedia/src/multimedia/audio/qaudiobufferinput.h