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

49 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.
//
#include "AudioInput.h"
#if defined(__ANDROID__)
#include "../os/android/AudioInputAndroid.h"
#elif defined(__APPLE__)
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
2017-02-02 17:24:40 +01:00
#include "../os/darwin/AudioInputAudioUnit.h"
#else
#include "../os/darwin/AudioInputAudioUnitOSX.h"
#endif
#elif defined(_WIN32)
#include "../os/windows/AudioInputWave.h"
#elif defined(__linux__)
#include "../os/linux/AudioInputALSA.h"
2017-02-02 17:24:40 +01:00
#else
#error "Unsupported operating system"
#endif
2017-03-30 16:06:59 +02:00
CAudioInput::CAudioInput(){
failed=false;
}
2017-02-02 17:24:40 +01:00
CAudioInput *CAudioInput::Create(){
#if defined(__ANDROID__)
return new CAudioInputAndroid();
#elif defined(__APPLE__)
return new CAudioInputAudioUnit();
#elif defined(_WIN32)
return new tgvoip::audio::AudioInputWave();
#elif defined(__linux__)
return new tgvoip::audio::AudioInputALSA();
2017-02-02 17:24:40 +01:00
#endif
}
CAudioInput::~CAudioInput(){
2017-02-02 17:24:40 +01:00
}
2017-03-30 16:06:59 +02:00
bool CAudioInput::IsInitialized(){
return !failed;
}