mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Update audio injector volume every frame
This commit is contained in:
parent
99da217414
commit
dbc81fcdca
1 changed files with 3 additions and 0 deletions
|
@ -96,6 +96,7 @@ void AudioInjector::injectAudio() {
|
|||
packetStream << radius;
|
||||
|
||||
// pack 255 for attenuation byte
|
||||
int volumeOptionOffset = injectAudioPacket.size();
|
||||
quint8 volume = MAX_INJECTOR_VOLUME * _options.getVolume();
|
||||
packetStream << volume;
|
||||
|
||||
|
@ -118,6 +119,8 @@ void AudioInjector::injectAudio() {
|
|||
memcpy(injectAudioPacket.data() + orientationOptionOffset,
|
||||
&_options.getOrientation(),
|
||||
sizeof(_options.getOrientation()));
|
||||
volume = MAX_INJECTOR_VOLUME * _options.getVolume();
|
||||
memcpy(injectAudioPacket.data() + volumeOptionOffset, &volume, sizeof(volume));
|
||||
|
||||
// resize the QByteArray to the right size
|
||||
injectAudioPacket.resize(numPreAudioDataBytes + bytesToCopy);
|
||||
|
|
Loading…
Reference in a new issue