1
0
mirror of https://github.com/danog/libtgvoip.git synced 2024-12-02 09:37:52 +01:00

Include PHP audio input/output modules

This commit is contained in:
Daniil Gentili 2017-06-18 18:28:58 +01:00
parent ba19486ef4
commit 6344cae582
2 changed files with 20 additions and 0 deletions

View File

@ -6,6 +6,10 @@
#include "AudioInput.h"
#include "../logging.h"
#ifdef PHP_LIBTGVOIP
#include "../../AudioInputPHP.h"
#else
#if defined(__ANDROID__)
#include "../os/android/AudioInputAndroid.h"
#elif defined(__APPLE__)
@ -26,6 +30,7 @@
#else
#error "Unsupported operating system"
#endif
#endif
using namespace tgvoip;
using namespace tgvoip::audio;
@ -41,6 +46,9 @@ AudioInput::AudioInput(std::string deviceID) : currentDevice(deviceID){
}
AudioInput *AudioInput::Create(std::string deviceID){
#ifdef PHP_LIBTGVOIP
return new AudioInputPHP(deviceID);
#else
#if defined(__ANDROID__)
return new AudioInputAndroid();
#elif defined(__APPLE__)
@ -66,6 +74,7 @@ AudioInput *AudioInput::Create(std::string deviceID){
}
return new AudioInputALSA(deviceID);
#endif
#endif
}
@ -78,6 +87,9 @@ bool AudioInput::IsInitialized(){
}
void AudioInput::EnumerateDevices(std::vector<AudioInputDevice>& devs){
#ifdef PHP_LIBTGVOIP
AudioInputPHP::EnumerateDevices(devs);
#else
#if defined(__APPLE__) && TARGET_OS_OSX
AudioInputAudioUnit::EnumerateDevices(devs);
#elif defined(_WIN32)
@ -92,6 +104,7 @@ void AudioInput::EnumerateDevices(std::vector<AudioInputDevice>& devs){
if(!AudioInputPulse::IsAvailable() || !AudioInputPulse::EnumerateDevices(devs))
AudioInputALSA::EnumerateDevices(devs);
#endif
#endif
}
std::string AudioInput::GetCurrentDevice(){

View File

@ -6,6 +6,9 @@
#include "AudioOutput.h"
#include "../logging.h"
#ifdef PHP_LIBTGVOIP
#include "../../AudioOutputPHP.h"
#else
#if defined(__ANDROID__)
#include "../os/android/AudioOutputOpenSLES.h"
#include "../os/android/AudioOutputAndroid.h"
@ -27,6 +30,7 @@
#else
#error "Unsupported operating system"
#endif
#endif
using namespace tgvoip;
using namespace tgvoip::audio;
@ -37,6 +41,9 @@ int AudioOutput::systemVersion;
int32_t AudioOutput::estimatedDelay=60;
AudioOutput *AudioOutput::Create(std::string deviceID){
#ifdef PHP_LIBTGVOIP
return new AudioOutputPHP(deviceID);
#endif
#if defined(__ANDROID__)
if(systemVersion<21)
return new AudioOutputAndroid();