1
0
mirror of https://github.com/danog/libtgvoip.git synced 2024-12-02 17:51:06 +01:00
libtgvoip/audio/AudioInput.h

45 lines
1.1 KiB
C
Raw Normal View History

2017-02-02 17:24:40 +01:00
//
// libtgvoip is free and unencumbered public domain software.
// For more information, see http://unlicense.org or the UNLICENSE file
// you should have received with this source code distribution.
//
#ifndef LIBTGVOIP_AUDIOINPUT_H
#define LIBTGVOIP_AUDIOINPUT_H
#include <stdint.h>
#include <vector>
#include <string>
2017-02-02 17:24:40 +01:00
#include "../MediaStreamItf.h"
namespace tgvoip{
class AudioInputDevice;
class AudioOutputDevice;
2017-07-13 17:43:13 +02:00
class VoIPController;
namespace audio{
class AudioInput : public MediaStreamItf{
2017-02-02 17:24:40 +01:00
public:
AudioInput();
AudioInput(std::string deviceID);
2017-07-13 17:43:13 +02:00
AudioInput(std::string deviceID, VoIPController* controller);
virtual ~AudioInput();
2017-02-02 17:24:40 +01:00
virtual void Configure(uint32_t sampleRate, uint32_t bitsPerSample, uint32_t channels)=0;
2017-03-30 16:06:59 +02:00
bool IsInitialized();
virtual std::string GetCurrentDevice();
virtual void SetCurrentDevice(std::string deviceID);
2017-07-13 17:43:13 +02:00
static AudioInput* Create(std::string deviceID, VoIPController* controller);
static void EnumerateDevices(std::vector<AudioInputDevice>& devs);
static int32_t GetEstimatedDelay();
2017-03-30 16:06:59 +02:00
protected:
std::string currentDevice;
2017-03-30 16:06:59 +02:00
bool failed;
static int32_t estimatedDelay;
2017-02-02 17:24:40 +01:00
};
}}
2017-02-02 17:24:40 +01:00
#endif //LIBTGVOIP_AUDIOINPUT_H