mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 15:53:28 +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
|
@ -776,13 +776,9 @@ void AudioMixer::run() {
|
||||||
// if the stream should be muted, send mute packet
|
// if the stream should be muted, send mute packet
|
||||||
if (nodeData->getAvatarAudioStream()
|
if (nodeData->getAvatarAudioStream()
|
||||||
&& shouldMute(nodeData->getAvatarAudioStream()->getQuietestFrameLoudness())) {
|
&& shouldMute(nodeData->getAvatarAudioStream()->getQuietestFrameLoudness())) {
|
||||||
static const int TIME_BETWEEN_MUTES = 5; // in secs
|
QByteArray packet = byteArrayWithPopulatedHeader(PacketTypeNoisyMute);
|
||||||
if (usecTimestampNow() - nodeData->getAvatarAudioStream()->getLastMuted() >
|
nodeList->writeDatagram(packet, node);
|
||||||
TIME_BETWEEN_MUTES * USECS_PER_SECOND) {
|
nodeData->getAvatarAudioStream()->setLastMutedNow();
|
||||||
QByteArray packet = byteArrayWithPopulatedHeader(PacketTypeNoisyMute);
|
|
||||||
nodeList->writeDatagram(packet, node);
|
|
||||||
nodeData->getAvatarAudioStream()->setLastMutedNow();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node->getType() == NodeType::Agent && node->getActiveSocket()
|
if (node->getType() == NodeType::Agent && node->getActiveSocket()
|
||||||
|
|
|
@ -14,8 +14,7 @@
|
||||||
#include "AvatarAudioStream.h"
|
#include "AvatarAudioStream.h"
|
||||||
|
|
||||||
AvatarAudioStream::AvatarAudioStream(bool isStereo, const InboundAudioStream::Settings& settings) :
|
AvatarAudioStream::AvatarAudioStream(bool isStereo, const InboundAudioStream::Settings& settings) :
|
||||||
PositionalAudioStream(PositionalAudioStream::Microphone, isStereo, settings),
|
PositionalAudioStream(PositionalAudioStream::Microphone, isStereo, settings)
|
||||||
_lastMuted(usecTimestampNow())
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,17 +20,12 @@ class AvatarAudioStream : public PositionalAudioStream {
|
||||||
public:
|
public:
|
||||||
AvatarAudioStream(bool isStereo, const InboundAudioStream::Settings& settings);
|
AvatarAudioStream(bool isStereo, const InboundAudioStream::Settings& settings);
|
||||||
|
|
||||||
qint64 getLastMuted() const { return _lastMuted; }
|
|
||||||
void setLastMutedNow() { _lastMuted = usecTimestampNow(); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// disallow copying of AvatarAudioStream objects
|
// disallow copying of AvatarAudioStream objects
|
||||||
AvatarAudioStream(const AvatarAudioStream&);
|
AvatarAudioStream(const AvatarAudioStream&);
|
||||||
AvatarAudioStream& operator= (const AvatarAudioStream&);
|
AvatarAudioStream& operator= (const AvatarAudioStream&);
|
||||||
|
|
||||||
int parseStreamProperties(PacketType type, const QByteArray& packetAfterSeqNum, int& numAudioSamples);
|
int parseStreamProperties(PacketType type, const QByteArray& packetAfterSeqNum, int& numAudioSamples);
|
||||||
|
|
||||||
qint64 _lastMuted;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_AvatarAudioStream_h
|
#endif // hifi_AvatarAudioStream_h
|
||||||
|
|
Loading…
Reference in a new issue