temp fix for dektop DSP build

This commit is contained in:
infactum 2019-02-14 20:37:38 +05:00
parent 0a53f7c0e6
commit 7578eba1ac
2 changed files with 44 additions and 40 deletions

View File

@ -664,7 +664,9 @@ target_compile_definitions(libtgvoip PRIVATE
DEFAULT_THREAD_PRIORITY)
target_compile_definitions(libtgvoip PUBLIC
TGVOIP_NO_DSP
# Chose one of NO_DSP / DESKTOP_DSP
# TGVOIP_NO_DSP
TGVOIP_USE_DESKTOP_DSP
TGVOIP_USE_SOFTWARE_AUDIO)
if (${spdlog_FOUND})

View File

@ -17,46 +17,48 @@
#include "modules/audio_processing/ns/defines.h"
#include "modules/audio_processing/ns/ns_core.h"
NsHandle* WebRtcNs_Create() {
NoiseSuppressionC* self = malloc(sizeof(NoiseSuppressionC));
self->initFlag = 0;
return (NsHandle*)self;
}
// Further code is commented to fix static linking issue with PJSIP which already includes some WebRTC code
void WebRtcNs_Free(NsHandle* NS_inst) {
free(NS_inst);
}
int WebRtcNs_Init(NsHandle* NS_inst, uint32_t fs) {
return WebRtcNs_InitCore((NoiseSuppressionC*)NS_inst, fs);
}
int WebRtcNs_set_policy(NsHandle* NS_inst, int mode) {
return WebRtcNs_set_policy_core((NoiseSuppressionC*)NS_inst, mode);
}
void WebRtcNs_Analyze(NsHandle* NS_inst, const float* spframe) {
WebRtcNs_AnalyzeCore((NoiseSuppressionC*)NS_inst, spframe);
}
void WebRtcNs_Process(NsHandle* NS_inst,
const float* const* spframe,
size_t num_bands,
float* const* outframe) {
WebRtcNs_ProcessCore((NoiseSuppressionC*)NS_inst, spframe, num_bands,
outframe);
}
float WebRtcNs_prior_speech_probability(NsHandle* handle) {
NoiseSuppressionC* self = (NoiseSuppressionC*)handle;
if (handle == NULL) {
return -1;
}
if (self->initFlag == 0) {
return -1;
}
return self->priorSpeechProb;
}
//NsHandle* WebRtcNs_Create() {
// NoiseSuppressionC* self = malloc(sizeof(NoiseSuppressionC));
// self->initFlag = 0;
// return (NsHandle*)self;
//}
//
//void WebRtcNs_Free(NsHandle* NS_inst) {
// free(NS_inst);
//}
//
//int WebRtcNs_Init(NsHandle* NS_inst, uint32_t fs) {
// return WebRtcNs_InitCore((NoiseSuppressionC*)NS_inst, fs);
//}
//
//int WebRtcNs_set_policy(NsHandle* NS_inst, int mode) {
// return WebRtcNs_set_policy_core((NoiseSuppressionC*)NS_inst, mode);
//}
//
//void WebRtcNs_Analyze(NsHandle* NS_inst, const float* spframe) {
// WebRtcNs_AnalyzeCore((NoiseSuppressionC*)NS_inst, spframe);
//}
//
//void WebRtcNs_Process(NsHandle* NS_inst,
// const float* const* spframe,
// size_t num_bands,
// float* const* outframe) {
// WebRtcNs_ProcessCore((NoiseSuppressionC*)NS_inst, spframe, num_bands,
// outframe);
//}
//
//float WebRtcNs_prior_speech_probability(NsHandle* handle) {
// NoiseSuppressionC* self = (NoiseSuppressionC*)handle;
// if (handle == NULL) {
// return -1;
// }
// if (self->initFlag == 0) {
// return -1;
// }
// return self->priorSpeechProb;
//}
const float* WebRtcNs_noise_estimate(const NsHandle* handle) {
const NoiseSuppressionC* self = (const NoiseSuppressionC*)handle;