-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathaudiocapture.h
More file actions
43 lines (32 loc) · 784 Bytes
/
Copy pathaudiocapture.h
File metadata and controls
43 lines (32 loc) · 784 Bytes
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
//
// Copyright (C) Tammo Hinrichs 2021. All rights reserved.
// Licensed under the MIT License. See LICENSE.md file for full license information
//
#pragma once
#include "types.h"
struct CaptureConfig;
enum class AudioFormat
{
None,
I16,
F32,
};
struct AudioInfo
{
AudioFormat Format;
uint Channels;
uint SampleRate;
uint BytesPerSample;
};
class IAudioCapture
{
public:
virtual ~IAudioCapture() {}
virtual AudioInfo GetInfo() const = 0;
virtual uint Read(uint8* dest, uint size, double &time) = 0; // size in bytes
virtual void JumpToTime(double time) = 0;
virtual void Flush() = 0;
};
void InitAudioCapture();
void GetAudioDevices(Array<String> &into);
IAudioCapture *CreateAudioCaptureWASAPI(const CaptureConfig &config);