Voice: Minor options menu fixes, fix decibel level freezing on muted speakers
This commit is contained in:
parent
3aa45ab799
commit
043db1841e
@ -223,5 +223,6 @@ end
|
||||
|
||||
function voiceToggle()
|
||||
set("enabled", not settings.enabled)
|
||||
widget.playSound(fmt("/sfx/interface/voice_%s.ogg", settings.enabled and "on" or "off"), 0)
|
||||
updateVoiceButton()
|
||||
end
|
@ -42,6 +42,7 @@
|
||||
"base" : "/interface/optionsmenu/tricontrolsbutton.png",
|
||||
"hover" : "/interface/optionsmenu/tricontrolsbuttonhover.png"
|
||||
},
|
||||
"sfxValueLabel" : { "position" : [192, 142] } // this is 2px too low in vanilla lol
|
||||
"sfxValueLabel" : { "position" : [192, 142] }, // this is 2px too low in vanilla lol
|
||||
"musicSlider" : { "position" : [62, 126] }
|
||||
}
|
||||
}
|
BIN
assets/opensb/interface/optionsmenu/shine.png
Normal file
BIN
assets/opensb/interface/optionsmenu/shine.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
BIN
assets/opensb/sfx/interface/voice_off.ogg
Normal file
BIN
assets/opensb/sfx/interface/voice_off.ogg
Normal file
Binary file not shown.
BIN
assets/opensb/sfx/interface/voice_on.ogg
Normal file
BIN
assets/opensb/sfx/interface/voice_on.ogg
Normal file
Binary file not shown.
@ -362,13 +362,14 @@ void Voice::mix(int16_t* buffer, size_t frameCount, unsigned channels) {
|
||||
VoiceAudioStream* audio = speaker->audioStream.get();
|
||||
MutexLocker audioLock(audio->mutex);
|
||||
if (speaker->playing && !audio->samples.empty()) {
|
||||
for (size_t i = 0; i != samples; ++i)
|
||||
speakerBuffer[i] = audio->take();
|
||||
|
||||
if (speaker != m_clientSpeaker)
|
||||
speaker->decibelLevel = getAudioLoudness(speakerBuffer.data(), samples);
|
||||
|
||||
if (!speaker->muted) {
|
||||
mix = true;
|
||||
for (size_t i = 0; i != samples; ++i)
|
||||
speakerBuffer[i] = audio->take();
|
||||
|
||||
if (speaker != m_clientSpeaker)
|
||||
speaker->decibelLevel = getAudioLoudness(speakerBuffer.data(), samples);
|
||||
|
||||
float volume = speaker->volume;
|
||||
Array2F levels = speaker->channelVolumes;
|
||||
@ -396,10 +397,6 @@ void Voice::mix(int16_t* buffer, size_t frameCount, unsigned channels) {
|
||||
}
|
||||
//*/
|
||||
}
|
||||
else {
|
||||
for (size_t i = 0; i != samples; ++i)
|
||||
audio->take();
|
||||
}
|
||||
++it;
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user