mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 01:33:35 +02:00
Remove lastMuted member in AvatarAudioStream
This commit is contained in:
parent
46eebe9d40
commit
4615afe034
3 changed files with 4 additions and 14 deletions
assignment-client/src/audio
|
@ -776,13 +776,9 @@ void AudioMixer::run() {
|
|||
// if the stream should be muted, send mute packet
|
||||
if (nodeData->getAvatarAudioStream()
|
||||
&& shouldMute(nodeData->getAvatarAudioStream()->getQuietestFrameLoudness())) {
|
||||
static const int TIME_BETWEEN_MUTES = 5; // in secs
|
||||
if (usecTimestampNow() - nodeData->getAvatarAudioStream()->getLastMuted() >
|
||||
TIME_BETWEEN_MUTES * USECS_PER_SECOND) {
|
||||
QByteArray packet = byteArrayWithPopulatedHeader(PacketTypeNoisyMute);
|
||||
nodeList->writeDatagram(packet, node);
|
||||
nodeData->getAvatarAudioStream()->setLastMutedNow();
|
||||
}
|
||||
QByteArray packet = byteArrayWithPopulatedHeader(PacketTypeNoisyMute);
|
||||
nodeList->writeDatagram(packet, node);
|
||||
nodeData->getAvatarAudioStream()->setLastMutedNow();
|
||||
}
|
||||
|
||||
if (node->getType() == NodeType::Agent && node->getActiveSocket()
|
||||
|
|
|
@ -14,8 +14,7 @@
|
|||
#include "AvatarAudioStream.h"
|
||||
|
||||
AvatarAudioStream::AvatarAudioStream(bool isStereo, const InboundAudioStream::Settings& settings) :
|
||||
PositionalAudioStream(PositionalAudioStream::Microphone, isStereo, settings),
|
||||
_lastMuted(usecTimestampNow())
|
||||
PositionalAudioStream(PositionalAudioStream::Microphone, isStereo, settings)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -20,17 +20,12 @@ class AvatarAudioStream : public PositionalAudioStream {
|
|||
public:
|
||||
AvatarAudioStream(bool isStereo, const InboundAudioStream::Settings& settings);
|
||||
|
||||
qint64 getLastMuted() const { return _lastMuted; }
|
||||
void setLastMutedNow() { _lastMuted = usecTimestampNow(); }
|
||||
|
||||
private:
|
||||
// disallow copying of AvatarAudioStream objects
|
||||
AvatarAudioStream(const AvatarAudioStream&);
|
||||
AvatarAudioStream& operator= (const AvatarAudioStream&);
|
||||
|
||||
int parseStreamProperties(PacketType type, const QByteArray& packetAfterSeqNum, int& numAudioSamples);
|
||||
|
||||
qint64 _lastMuted;
|
||||
};
|
||||
|
||||
#endif // hifi_AvatarAudioStream_h
|
||||
|
|
Loading…
Reference in a new issue