Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 5 files). Show all
Unified · Split
| @@ -505,6 +505,11 @@ void ScriptEngine::run() { · 504 unmodified lines | |||
| 505 | // write the number of silent samples so the audio-mixer can uphold timing | 505 | // write the number of silent samples so the audio-mixer can uphold timing |
| 506 | packetStream.writeRawData(reinterpret_cast<const char*>(&SCRIPT_AUDIO_BUFFER_SAMPLES), sizeof(int16_t)); | 506 | packetStream.writeRawData(reinterpret_cast<const char*>(&SCRIPT_AUDIO_BUFFER_SAMPLES), sizeof(int16_t)); |
| 507 | 507 | ||
| 508 | // use the orientation and position of this avatar for the source of this audio | ||
| 509 | packetStream.writeRawData(reinterpret_cast<const char*>(&_avatarData->getPosition()), sizeof(glm::vec3)); | ||
| 510 | glm::quat headOrientation = _avatarData->getHeadOrientation(); | ||
| 511 | packetStream.writeRawData(reinterpret_cast<const char*>(&headOrientation), sizeof(glm::quat)); | ||
| 512 | |||
| 508 | } else if (nextSoundOutput) { | 513 | } else if (nextSoundOutput) { |
| 509 | // assume scripted avatar audio is mono and set channel flag to zero | 514 | // assume scripted avatar audio is mono and set channel flag to zero |
| 510 | packetStream << (quint8)0; | 515 | packetStream << (quint8)0; |