mirror of
https://github.com/overte-org/overte.git
synced 2025-06-17 01:00:16 +02:00
Fix MS20089: Enable interrupting of avatar recordings with sounds
This commit is contained in:
parent
78c9fb2b91
commit
240917e8ae
2 changed files with 12 additions and 0 deletions
|
@ -756,6 +756,11 @@ void Agent::processAgentAvatarAudio() {
|
||||||
const int16_t* nextSoundOutput = NULL;
|
const int16_t* nextSoundOutput = NULL;
|
||||||
|
|
||||||
if (_avatarSound) {
|
if (_avatarSound) {
|
||||||
|
if (isPlayingRecording) {
|
||||||
|
recordingInterface->stopPlaying();
|
||||||
|
_recordingInterrupted = true;
|
||||||
|
}
|
||||||
|
|
||||||
auto audioData = _avatarSound->getAudioData();
|
auto audioData = _avatarSound->getAudioData();
|
||||||
nextSoundOutput = reinterpret_cast<const int16_t*>(audioData->rawData()
|
nextSoundOutput = reinterpret_cast<const int16_t*>(audioData->rawData()
|
||||||
+ _numAvatarSoundSentBytes);
|
+ _numAvatarSoundSentBytes);
|
||||||
|
@ -781,6 +786,11 @@ void Agent::processAgentAvatarAudio() {
|
||||||
_avatarSound.clear();
|
_avatarSound.clear();
|
||||||
_numAvatarSoundSentBytes = 0;
|
_numAvatarSoundSentBytes = 0;
|
||||||
_flushEncoder = true;
|
_flushEncoder = true;
|
||||||
|
|
||||||
|
if (_recordingInterrupted) {
|
||||||
|
_recordingInterrupted = false;
|
||||||
|
recordingInterface->startPlaying();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,6 +122,8 @@ private:
|
||||||
Encoder* _encoder { nullptr };
|
Encoder* _encoder { nullptr };
|
||||||
QTimer _avatarAudioTimer;
|
QTimer _avatarAudioTimer;
|
||||||
bool _flushEncoder { false };
|
bool _flushEncoder { false };
|
||||||
|
|
||||||
|
bool _recordingInterrupted { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_Agent_h
|
#endif // hifi_Agent_h
|
||||||
|
|
Loading…
Reference in a new issue