mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 03:13:09 +02:00
Keep playing the recording visually
This commit is contained in:
parent
240917e8ae
commit
2964a05bd3
2 changed files with 9 additions and 8 deletions
|
@ -428,6 +428,10 @@ void Agent::executeScript() {
|
||||||
using namespace recording;
|
using namespace recording;
|
||||||
static const FrameType AUDIO_FRAME_TYPE = Frame::registerFrameType(AudioConstants::getAudioFrameName());
|
static const FrameType AUDIO_FRAME_TYPE = Frame::registerFrameType(AudioConstants::getAudioFrameName());
|
||||||
Frame::registerFrameHandler(AUDIO_FRAME_TYPE, [this, &scriptedAvatar](Frame::ConstPointer frame) {
|
Frame::registerFrameHandler(AUDIO_FRAME_TYPE, [this, &scriptedAvatar](Frame::ConstPointer frame) {
|
||||||
|
if (_shouldMuteRecordingAudio) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static quint16 audioSequenceNumber{ 0 };
|
static quint16 audioSequenceNumber{ 0 };
|
||||||
|
|
||||||
QByteArray audio(frame->data);
|
QByteArray audio(frame->data);
|
||||||
|
@ -756,9 +760,8 @@ void Agent::processAgentAvatarAudio() {
|
||||||
const int16_t* nextSoundOutput = NULL;
|
const int16_t* nextSoundOutput = NULL;
|
||||||
|
|
||||||
if (_avatarSound) {
|
if (_avatarSound) {
|
||||||
if (isPlayingRecording) {
|
if (isPlayingRecording && !_shouldMuteRecordingAudio) {
|
||||||
recordingInterface->stopPlaying();
|
_shouldMuteRecordingAudio = true;
|
||||||
_recordingInterrupted = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto audioData = _avatarSound->getAudioData();
|
auto audioData = _avatarSound->getAudioData();
|
||||||
|
@ -787,9 +790,8 @@ void Agent::processAgentAvatarAudio() {
|
||||||
_numAvatarSoundSentBytes = 0;
|
_numAvatarSoundSentBytes = 0;
|
||||||
_flushEncoder = true;
|
_flushEncoder = true;
|
||||||
|
|
||||||
if (_recordingInterrupted) {
|
if (_shouldMuteRecordingAudio) {
|
||||||
_recordingInterrupted = false;
|
_shouldMuteRecordingAudio = false;
|
||||||
recordingInterface->startPlaying();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,6 +107,7 @@ private:
|
||||||
ResourceRequest* _pendingScriptRequest { nullptr };
|
ResourceRequest* _pendingScriptRequest { nullptr };
|
||||||
bool _isListeningToAudioStream = false;
|
bool _isListeningToAudioStream = false;
|
||||||
SharedSoundPointer _avatarSound;
|
SharedSoundPointer _avatarSound;
|
||||||
|
bool _shouldMuteRecordingAudio{ false };
|
||||||
int _numAvatarSoundSentBytes = 0;
|
int _numAvatarSoundSentBytes = 0;
|
||||||
bool _isAvatar = false;
|
bool _isAvatar = false;
|
||||||
QTimer* _avatarIdentityTimer = nullptr;
|
QTimer* _avatarIdentityTimer = nullptr;
|
||||||
|
@ -122,8 +123,6 @@ 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