blob: bcfa4fb7593c72aa05dc9609f836ffb25a8b6e80 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
// Copyright 2007-2021 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
#ifndef MUMBLE_MUMBLE_AUDIO_H_
#define MUMBLE_MUMBLE_AUDIO_H_
#include <QtCore/QByteArray>
#include <QtCore/QElapsedTimer>
#include <QtCore/QMultiMap>
#include <QtCore/QMutex>
#include <QtCore/QString>
#include <QtCore/QVariant>
#include "ClientUser.h"
#define SAMPLE_RATE 48000
typedef QPair< QString, QVariant > audioDevice;
class LoopUser : public ClientUser {
private:
Q_DISABLE_COPY(LoopUser)
protected:
QMutex qmLock;
QElapsedTimer qetTicker;
QElapsedTimer qetLastFetch;
QMultiMap< float, QByteArray > qmPackets;
LoopUser();
public:
static LoopUser lpLoopy;
virtual void addFrame(const QByteArray &packet);
void fetchFrames();
};
class RecordUser : public LoopUser {
private:
Q_OBJECT
Q_DISABLE_COPY(RecordUser)
public:
RecordUser();
~RecordUser() Q_DECL_OVERRIDE;
void addFrame(const QByteArray &packet) Q_DECL_OVERRIDE;
};
namespace Audio {
void startInput(const QString &input = QString());
void stopInput();
void startOutput(const QString &output = QString());
void stopOutput();
void start(const QString &input = QString(), const QString &output = QString());
void stop();
} // namespace Audio
#endif
|