mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01: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;
|
||||
|
||||
if (_avatarSound) {
|
||||
if (isPlayingRecording) {
|
||||
recordingInterface->stopPlaying();
|
||||
_recordingInterrupted = true;
|
||||
}
|
||||
|
||||
auto audioData = _avatarSound->getAudioData();
|
||||
nextSoundOutput = reinterpret_cast<const int16_t*>(audioData->rawData()
|
||||
+ _numAvatarSoundSentBytes);
|
||||
|
@ -781,6 +786,11 @@ void Agent::processAgentAvatarAudio() {
|
|||
_avatarSound.clear();
|
||||
_numAvatarSoundSentBytes = 0;
|
||||
_flushEncoder = true;
|
||||
|
||||
if (_recordingInterrupted) {
|
||||
_recordingInterrupted = false;
|
||||
recordingInterface->startPlaying();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -122,6 +122,8 @@ private:
|
|||
Encoder* _encoder { nullptr };
|
||||
QTimer _avatarAudioTimer;
|
||||
bool _flushEncoder { false };
|
||||
|
||||
bool _recordingInterrupted { false };
|
||||
};
|
||||
|
||||
#endif // hifi_Agent_h
|
||||
|
|
Loading…
Reference in a new issue