mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-17 02:49:34 -04:00
Renaming all to VOIP in VOIP plugin (patch from Phenom)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8231 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a3b32b92d5
commit
b5bf3ce130
29 changed files with 860 additions and 686 deletions
|
@ -12,7 +12,7 @@
|
|||
#include <QDateTime>
|
||||
#include <limits.h>
|
||||
|
||||
#include "interface/rsvoip.h"
|
||||
#include "interface/rsVOIP.h"
|
||||
|
||||
//#include "gui/settings/rsharesettings.h"
|
||||
|
||||
|
@ -165,7 +165,7 @@ qint64 SpeexInputProcessor::writeData(const char *data, qint64 maxSize) {
|
|||
iArg = -60;
|
||||
speex_preprocess_ctl(preprocessor, SPEEX_PREPROCESS_SET_AGC_DECREMENT, &iArg);
|
||||
|
||||
iArg = rsVoip->getVoipiNoiseSuppress();
|
||||
iArg = rsVOIP->getVoipiNoiseSuppress();
|
||||
speex_preprocess_ctl(preprocessor, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &iArg);
|
||||
|
||||
if (echo_state) {
|
||||
|
@ -177,18 +177,18 @@ qint64 SpeexInputProcessor::writeData(const char *data, qint64 maxSize) {
|
|||
bResetProcessor = false;
|
||||
}
|
||||
|
||||
float v = 30000.0f / static_cast<float>(rsVoip->getVoipiMinLoudness());
|
||||
float v = 30000.0f / static_cast<float>(rsVOIP->getVoipiMinLoudness());
|
||||
|
||||
iArg = iroundf(floorf(20.0f * log10f(v)));
|
||||
speex_preprocess_ctl(preprocessor, SPEEX_PREPROCESS_SET_AGC_MAX_GAIN, &iArg);
|
||||
|
||||
speex_preprocess_ctl(preprocessor, SPEEX_PREPROCESS_GET_AGC_GAIN, &iArg);
|
||||
float gainValue = static_cast<float>(iArg);
|
||||
iArg = rsVoip->getVoipiNoiseSuppress() - iArg;
|
||||
iArg = rsVOIP->getVoipiNoiseSuppress() - iArg;
|
||||
speex_preprocess_ctl(preprocessor, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &iArg);
|
||||
|
||||
short * psSource = psMic;
|
||||
if (echo_state && rsVoip->getVoipEchoCancel()) {
|
||||
if (echo_state && rsVOIP->getVoipEchoCancel()) {
|
||||
speex_echo_playback(echo_state, (short*)lastEchoFrame->data());
|
||||
speex_echo_capture(echo_state,psMic,psClean);
|
||||
psSource = psClean;
|
||||
|
@ -212,29 +212,29 @@ qint64 SpeexInputProcessor::writeData(const char *data, qint64 maxSize) {
|
|||
|
||||
bool bIsSpeech = false;
|
||||
|
||||
if (dVoiceAcivityLevel > (static_cast<float>(rsVoip->getVoipfVADmax()) / 32767))
|
||||
if (dVoiceAcivityLevel > (static_cast<float>(rsVOIP->getVoipfVADmax()) / 32767))
|
||||
bIsSpeech = true;
|
||||
else if (dVoiceAcivityLevel > (static_cast<float>(rsVoip->getVoipfVADmin()) / 32767) && bPreviousVoice)
|
||||
else if (dVoiceAcivityLevel > (static_cast<float>(rsVOIP->getVoipfVADmin()) / 32767) && bPreviousVoice)
|
||||
bIsSpeech = true;
|
||||
|
||||
if (! bIsSpeech) {
|
||||
iHoldFrames++;
|
||||
if (iHoldFrames < rsVoip->getVoipVoiceHold())
|
||||
if (iHoldFrames < rsVOIP->getVoipVoiceHold())
|
||||
bIsSpeech = true;
|
||||
} else {
|
||||
iHoldFrames = 0;
|
||||
}
|
||||
|
||||
|
||||
if (rsVoip->getVoipATransmit() == RsVoip::AudioTransmitContinous) {
|
||||
if (rsVOIP->getVoipATransmit() == RsVOIP::AudioTransmitContinous) {
|
||||
bIsSpeech = true;
|
||||
}
|
||||
else if (rsVoip->getVoipATransmit() == RsVoip::AudioTransmitPushToTalk)
|
||||
else if (rsVOIP->getVoipATransmit() == RsVOIP::AudioTransmitPushToTalk)
|
||||
bIsSpeech = false;//g.s.uiDoublePush && ((g.uiDoublePush < g.s.uiDoublePush) || (g.tDoublePush.elapsed() < g.s.uiDoublePush));
|
||||
|
||||
//bIsSpeech = bIsSpeech || (g.iPushToTalk > 0);
|
||||
|
||||
/*if (g.s.bMute || ((g.s.lmLoopMode != RsVoip::Local) && p && (p->bMute || p->bSuppress)) || g.bPushToMute || (g.iTarget < 0)) {
|
||||
/*if (g.s.bMute || ((g.s.lmLoopMode != RsVOIP::Local) && p && (p->bMute || p->bSuppress)) || g.bPushToMute || (g.iTarget < 0)) {
|
||||
bIsSpeech = false;
|
||||
}*/
|
||||
|
||||
|
@ -246,11 +246,11 @@ qint64 SpeexInputProcessor::writeData(const char *data, qint64 maxSize) {
|
|||
|
||||
/*if (p) {
|
||||
if (! bIsSpeech)
|
||||
p->setTalking(RsVoip::Passive);
|
||||
p->setTalking(RsVOIP::Passive);
|
||||
else if (g.iTarget == 0)
|
||||
p->setTalking(RsVoip::Talking);
|
||||
p->setTalking(RsVOIP::Talking);
|
||||
else
|
||||
p->setTalking(RsVoip::Shouting);
|
||||
p->setTalking(RsVOIP::Shouting);
|
||||
}*/
|
||||
|
||||
|
||||
|
@ -271,7 +271,7 @@ qint64 SpeexInputProcessor::writeData(const char *data, qint64 maxSize) {
|
|||
int vbr_on=0;
|
||||
//just use fixed bitrate for now
|
||||
//encryption of VBR-encoded speech may not ensure complete privacy, as phrases can still be identified, at least in a controlled setting with a small dictionary of phrases, by analysing the pattern of variation of the bit rate.
|
||||
if (rsVoip->getVoipATransmit() == RsVoip::AudioTransmitVAD) {//maybe we can do fixer bitrate when voice detection is active
|
||||
if (rsVOIP->getVoipATransmit() == RsVOIP::AudioTransmitVAD) {//maybe we can do fixer bitrate when voice detection is active
|
||||
vbr_on = 1;//test it on for all modes
|
||||
} else {//maybe we can do vbr for ppt and continuous
|
||||
vbr_on = 1;
|
||||
|
@ -370,7 +370,7 @@ bool SpeexInputProcessor::isSequential() const {
|
|||
}
|
||||
|
||||
void SpeexInputProcessor::addEchoFrame(QByteArray* echo_frame) {
|
||||
if (rsVoip->getVoipEchoCancel() && echo_frame) {
|
||||
if (rsVOIP->getVoipEchoCancel() && echo_frame) {
|
||||
QMutexLocker l(&qmSpeex);
|
||||
lastEchoFrame = echo_frame;
|
||||
if (!echo_state) {//init echo_state
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue