mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 22:40:27 +02:00
fix bandwidth meter for audio
This commit is contained in:
parent
d1054b3cfc
commit
487209e270
1 changed files with 6 additions and 2 deletions
|
@ -277,6 +277,9 @@ void Audio::handleAudioInput() {
|
||||||
nodeList->getNodeSocket().writeDatagram(monoAudioDataPacket, BUFFER_LENGTH_BYTES_PER_CHANNEL + leadingBytes,
|
nodeList->getNodeSocket().writeDatagram(monoAudioDataPacket, BUFFER_LENGTH_BYTES_PER_CHANNEL + leadingBytes,
|
||||||
audioMixer->getActiveSocket()->getAddress(),
|
audioMixer->getActiveSocket()->getAddress(),
|
||||||
audioMixer->getActiveSocket()->getPort());
|
audioMixer->getActiveSocket()->getPort());
|
||||||
|
|
||||||
|
Application::getInstance()->getBandwidthMeter()->outputStream(BandwidthMeter::AUDIO)
|
||||||
|
.updateValue(BUFFER_LENGTH_BYTES_PER_CHANNEL + leadingBytes);
|
||||||
} else {
|
} else {
|
||||||
nodeList->pingPublicAndLocalSocketsForInactiveNode(audioMixer);
|
nodeList->pingPublicAndLocalSocketsForInactiveNode(audioMixer);
|
||||||
}
|
}
|
||||||
|
@ -341,6 +344,7 @@ void Audio::handleAudioInput() {
|
||||||
|
|
||||||
_outputDevice->write(stereoOutputBuffer);
|
_outputDevice->write(stereoOutputBuffer);
|
||||||
|
|
||||||
|
|
||||||
// add output (@speakers) data just written to the scope
|
// add output (@speakers) data just written to the scope
|
||||||
QMetaObject::invokeMethod(_scope, "addStereoSamples", Qt::QueuedConnection,
|
QMetaObject::invokeMethod(_scope, "addStereoSamples", Qt::QueuedConnection,
|
||||||
Q_ARG(QByteArray, stereoOutputBuffer), Q_ARG(bool, false));
|
Q_ARG(QByteArray, stereoOutputBuffer), Q_ARG(bool, false));
|
||||||
|
@ -391,8 +395,8 @@ void Audio::addReceivedAudioToBuffer(const QByteArray& audioByteArray) {
|
||||||
|
|
||||||
_ringBuffer.parseData((unsigned char*) audioByteArray.data(), audioByteArray.size());
|
_ringBuffer.parseData((unsigned char*) audioByteArray.data(), audioByteArray.size());
|
||||||
|
|
||||||
Application::getInstance()->getBandwidthMeter()->inputStream(BandwidthMeter::AUDIO)
|
Application::getInstance()->getBandwidthMeter()->inputStream(BandwidthMeter::AUDIO).updateValue(PACKET_LENGTH_BYTES
|
||||||
.updateValue(PACKET_LENGTH_BYTES + sizeof(PACKET_TYPE));
|
+ sizeof(PACKET_TYPE));
|
||||||
|
|
||||||
_lastReceiveTime = currentReceiveTime;
|
_lastReceiveTime = currentReceiveTime;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue