Agent needs to be sure audio is ready before trying to use it

This commit is contained in:
David Kelly 2018-12-13 17:41:12 -08:00
parent 3e10bea1ce
commit 2b21ceb17a

View file

@ -755,7 +755,7 @@ void Agent::processAgentAvatarAudio() {
int16_t numAvailableSamples = AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL;
const int16_t* nextSoundOutput = NULL;
if (_avatarSound) {
if (_avatarSound && _avatarSound->isReady()) {
auto audioData = _avatarSound->getAudioData();
nextSoundOutput = reinterpret_cast<const int16_t*>(audioData->rawData()
+ _numAvatarSoundSentBytes);