This commit is contained in:
ZappoMan 2014-04-16 15:21:04 -07:00
parent 2e0c5fc81b
commit 3cb109ec89
2 changed files with 5 additions and 13 deletions

View file

@ -564,12 +564,9 @@ void Audio::handleAudioInput() {
_lastInputLoudness = 0;
}
// at this point we have clean monoAudioSamples, which match our target output... this is what we should send
// to our interested listeners
// send our local loopback to any interested parties
// at this point we have clean monoAudioSamples, which match our target output...
// this is what we should send to our interested listeners
if (_processSpatialAudio && !_muted && _audioOutput) {
// local audio is sent already resampled to match the network input format, so processors
// can easily handle the audio in a format ready to post back to the audio device
QByteArray monoInputData((char*)monoAudioSamples, NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL * sizeof(int16_t));
emit processLocalAudio(_spatialAudioStart, monoInputData, _desiredInputFormat);
}

View file

@ -186,22 +186,19 @@ void AudioReflector::injectAudiblePoint(AudioSource source, const AudiblePoint&
bool safeToInject = true; // assume the best
// check to see if this new injection point would be within the comb filter
// suppression window for any of the existing known delays
QMap<float, float>& knownDelays = (source == INBOUND_AUDIO) ? _inboundAudioDelays : _localAudioDelays;
// check to see if the known delays is too close
QMap<float, float>::const_iterator lowerBound = knownDelays.lowerBound(averageEarDelayMsecs - _combFilterWindow);
if (lowerBound != knownDelays.end()) {
float closestFound = lowerBound.value();
float deltaToClosest = (averageEarDelayMsecs - closestFound);
//qDebug() << "knownDelays=" << knownDelays;
//qDebug() << "averageEarDelayMsecs=" << averageEarDelayMsecs << " closestFound=" << closestFound;
//qDebug() << "deltaToClosest=" << deltaToClosest;
if (deltaToClosest > -_combFilterWindow && deltaToClosest < _combFilterWindow) {
//qDebug() << "**** WE THINK WE'RE TOO CLOSE!! ****";
safeToInject = false;
}
}
// keep track of any of our suppressed echoes so we can report them in our statistics
if (!safeToInject) {
QVector<float>& suppressedEchoes = (source == INBOUND_AUDIO) ? _inboundEchoesSuppressed : _localEchoesSuppressed;
suppressedEchoes << averageEarDelayMsecs;
@ -275,7 +272,6 @@ void AudioReflector::processLocalAudio(unsigned int sampleTime, const QByteArray
_localAudioDelays.clear();
_localEchoesSuppressed.clear();
echoAudio(LOCAL_AUDIO, sampleTime, stereoInputData, outputFormat);
//qDebug() << _localAudioDelays;
}
}
}
@ -284,7 +280,6 @@ void AudioReflector::processInboundAudio(unsigned int sampleTime, const QByteArr
_inboundAudioDelays.clear();
_inboundEchoesSuppressed.clear();
echoAudio(INBOUND_AUDIO, sampleTime, samples, format);
//qDebug() << _inboundAudioDelays;
}
void AudioReflector::echoAudio(AudioSource source, unsigned int sampleTime, const QByteArray& samples, const QAudioFormat& format) {