Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qaudiosource.h
Go to the documentation of this file.
1// Copyright (C) 2016 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
5#ifndef QAUDIOINPUT_H
6#define QAUDIOINPUT_H
7
8#include <QtCore/qiodevice.h>
9
10#include <QtMultimedia/qtmultimediaglobal.h>
11
12#include <QtMultimedia/qaudio.h>
13#include <QtMultimedia/qaudioformat.h>
14#include <QtMultimedia/qaudiodevice.h>
15
16
18
20
21class Q_MULTIMEDIA_EXPORT QAudioSource : public QObject
22{
24
25public:
26 explicit QAudioSource(const QAudioFormat &format = QAudioFormat(), QObject *parent = nullptr);
27 explicit QAudioSource(const QAudioDevice &audioDeviceInfo, const QAudioFormat &format = QAudioFormat(), QObject *parent = nullptr);
29
30 bool isNull() const { return !d; }
31
32 QAudioFormat format() const;
33
34 void start(QIODevice *device);
36
37 void stop();
38 void reset();
39 void suspend();
40 void resume();
41
42 void setBufferSize(qsizetype bytes);
43 qsizetype bufferSize() const;
44
45 qsizetype bytesAvailable() const;
46
47 void setVolume(qreal volume);
48 qreal volume() const;
49
50 qint64 processedUSecs() const;
51 qint64 elapsedUSecs() const;
52
53 QAudio::Error error() const;
54 QAudio::State state() const;
55
58
59private:
60 Q_DISABLE_COPY(QAudioSource)
61
63};
64
66
67#endif // QAUDIOINPUT_H
IOBluetoothDevice * device
The QAudioDevice class provides an information about audio devices and their functionality.
The QAudioFormat class stores audio stream parameter information.
The QAudioSource class provides an interface for receiving audio data from an audio input device.
bool isNull() const
Returns true if the audio source is null, otherwise returns false.
void stateChanged(QAudio::State state)
This signal is emitted when the device state has changed.
\inmodule QtCore \reentrant
Definition qiodevice.h:34
\inmodule QtCore
Definition qobject.h:90
else opt state
[0]
State
\value ActiveState Audio data is being processed, this state is set after start() is called and while...
Definition qaudio.h:25
Error
\value NoError No errors have occurred \value OpenError An error occurred opening the audio device \v...
Definition qaudio.h:24
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLuint start
GLint GLsizei GLsizei GLenum format
GLboolean reset
#define Q_OBJECT
#define Q_SIGNALS
ptrdiff_t qsizetype
Definition qtypes.h:70
long long qint64
Definition qtypes.h:55
double qreal
Definition qtypes.h:92
future resume()
future suspend()
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent