mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 07:44:09 +02:00
clean up
This commit is contained in:
parent
2e0c5fc81b
commit
3cb109ec89
2 changed files with 5 additions and 13 deletions
|
@ -564,12 +564,9 @@ void Audio::handleAudioInput() {
|
||||||
_lastInputLoudness = 0;
|
_lastInputLoudness = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// at this point we have clean monoAudioSamples, which match our target output... this is what we should send
|
// at this point we have clean monoAudioSamples, which match our target output...
|
||||||
// to our interested listeners
|
// this is what we should send to our interested listeners
|
||||||
// send our local loopback to any interested parties
|
|
||||||
if (_processSpatialAudio && !_muted && _audioOutput) {
|
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));
|
QByteArray monoInputData((char*)monoAudioSamples, NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL * sizeof(int16_t));
|
||||||
emit processLocalAudio(_spatialAudioStart, monoInputData, _desiredInputFormat);
|
emit processLocalAudio(_spatialAudioStart, monoInputData, _desiredInputFormat);
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,22 +186,19 @@ void AudioReflector::injectAudiblePoint(AudioSource source, const AudiblePoint&
|
||||||
|
|
||||||
bool safeToInject = true; // assume the best
|
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;
|
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);
|
QMap<float, float>::const_iterator lowerBound = knownDelays.lowerBound(averageEarDelayMsecs - _combFilterWindow);
|
||||||
if (lowerBound != knownDelays.end()) {
|
if (lowerBound != knownDelays.end()) {
|
||||||
float closestFound = lowerBound.value();
|
float closestFound = lowerBound.value();
|
||||||
float deltaToClosest = (averageEarDelayMsecs - closestFound);
|
float deltaToClosest = (averageEarDelayMsecs - closestFound);
|
||||||
//qDebug() << "knownDelays=" << knownDelays;
|
|
||||||
//qDebug() << "averageEarDelayMsecs=" << averageEarDelayMsecs << " closestFound=" << closestFound;
|
|
||||||
//qDebug() << "deltaToClosest=" << deltaToClosest;
|
|
||||||
if (deltaToClosest > -_combFilterWindow && deltaToClosest < _combFilterWindow) {
|
if (deltaToClosest > -_combFilterWindow && deltaToClosest < _combFilterWindow) {
|
||||||
//qDebug() << "**** WE THINK WE'RE TOO CLOSE!! ****";
|
|
||||||
safeToInject = false;
|
safeToInject = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// keep track of any of our suppressed echoes so we can report them in our statistics
|
||||||
if (!safeToInject) {
|
if (!safeToInject) {
|
||||||
QVector<float>& suppressedEchoes = (source == INBOUND_AUDIO) ? _inboundEchoesSuppressed : _localEchoesSuppressed;
|
QVector<float>& suppressedEchoes = (source == INBOUND_AUDIO) ? _inboundEchoesSuppressed : _localEchoesSuppressed;
|
||||||
suppressedEchoes << averageEarDelayMsecs;
|
suppressedEchoes << averageEarDelayMsecs;
|
||||||
|
@ -275,7 +272,6 @@ void AudioReflector::processLocalAudio(unsigned int sampleTime, const QByteArray
|
||||||
_localAudioDelays.clear();
|
_localAudioDelays.clear();
|
||||||
_localEchoesSuppressed.clear();
|
_localEchoesSuppressed.clear();
|
||||||
echoAudio(LOCAL_AUDIO, sampleTime, stereoInputData, outputFormat);
|
echoAudio(LOCAL_AUDIO, sampleTime, stereoInputData, outputFormat);
|
||||||
//qDebug() << _localAudioDelays;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -284,7 +280,6 @@ void AudioReflector::processInboundAudio(unsigned int sampleTime, const QByteArr
|
||||||
_inboundAudioDelays.clear();
|
_inboundAudioDelays.clear();
|
||||||
_inboundEchoesSuppressed.clear();
|
_inboundEchoesSuppressed.clear();
|
||||||
echoAudio(INBOUND_AUDIO, sampleTime, samples, format);
|
echoAudio(INBOUND_AUDIO, sampleTime, samples, format);
|
||||||
//qDebug() << _inboundAudioDelays;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioReflector::echoAudio(AudioSource source, unsigned int sampleTime, const QByteArray& samples, const QAudioFormat& format) {
|
void AudioReflector::echoAudio(AudioSource source, unsigned int sampleTime, const QByteArray& samples, const QAudioFormat& format) {
|
||||||
|
|
Loading…
Reference in a new issue