mirror of
https://github.com/danog/libtgvoip.git
synced 2024-11-30 04:39:03 +01:00
30 lines
606 B
C++
30 lines
606 B
C++
#pragma once
|
|
#include <string>
|
|
#include "VoIPController.h"
|
|
#include "AudioIO.h"
|
|
#include "AudioInput.h"
|
|
|
|
namespace tgvoip
|
|
{
|
|
|
|
class AudioInputTester
|
|
{
|
|
public:
|
|
AudioInputTester(const std::string deviceID);
|
|
~AudioInputTester();
|
|
TGVOIP_DISALLOW_COPY_AND_ASSIGN(AudioInputTester);
|
|
float GetAndResetLevel();
|
|
bool Failed()
|
|
{
|
|
return io && io->Failed();
|
|
}
|
|
|
|
private:
|
|
void Update(int16_t *samples, size_t count);
|
|
std::shared_ptr<audio::AudioIO> io;
|
|
std::shared_ptr<audio::AudioInput> input;
|
|
int16_t maxSample = 0;
|
|
std::string deviceID;
|
|
};
|
|
|
|
} // namespace tgvoip
|