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>
|
2017-04-28 13:17:56 +02:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2017-02-02 17:24:40 +01:00
|
|
|
#include "../MediaStreamItf.h"
|
|
|
|
|
2017-04-28 13:17:56 +02:00
|
|
|
namespace tgvoip{
|
|
|
|
|
|
|
|
class AudioInputDevice;
|
|
|
|
class AudioOutputDevice;
|
|
|
|
|
|
|
|
namespace audio{
|
|
|
|
class AudioInput : public MediaStreamItf{
|
2017-02-02 17:24:40 +01:00
|
|
|
public:
|
2017-04-28 13:17:56 +02:00
|
|
|
AudioInput();
|
|
|
|
AudioInput(std::string deviceID);
|
2017-07-04 15:49:09 +02:00
|
|
|
AudioInput(std::string deviceID, void* controller);
|
2017-04-28 13:17:56 +02:00
|
|
|
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();
|
2017-04-28 13:17:56 +02:00
|
|
|
virtual std::string GetCurrentDevice();
|
|
|
|
virtual void SetCurrentDevice(std::string deviceID);
|
2017-07-04 15:49:09 +02:00
|
|
|
static AudioInput* Create(std::string deviceID, void* controller);
|
2017-04-28 13:17:56 +02:00
|
|
|
static void EnumerateDevices(std::vector<AudioInputDevice>& devs);
|
2017-05-14 15:28:17 +02:00
|
|
|
static int32_t GetEstimatedDelay();
|
2017-03-30 16:06:59 +02:00
|
|
|
|
|
|
|
protected:
|
2017-04-28 13:17:56 +02:00
|
|
|
std::string currentDevice;
|
2017-03-30 16:06:59 +02:00
|
|
|
bool failed;
|
2017-05-14 15:28:17 +02:00
|
|
|
static int32_t estimatedDelay;
|
2017-02-02 17:24:40 +01:00
|
|
|
};
|
2017-04-28 13:17:56 +02:00
|
|
|
}}
|
2017-02-02 17:24:40 +01:00
|
|
|
|
|
|
|
#endif //LIBTGVOIP_AUDIOINPUT_H
|