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()
|
function voiceToggle()
|
||||||
set("enabled", not settings.enabled)
|
set("enabled", not settings.enabled)
|
||||||
|
widget.playSound(fmt("/sfx/interface/voice_%s.ogg", settings.enabled and "on" or "off"), 0)
|
||||||
updateVoiceButton()
|
updateVoiceButton()
|
||||||
end
|
end
|
@ -42,6 +42,7 @@
|
|||||||
"base" : "/interface/optionsmenu/tricontrolsbutton.png",
|
"base" : "/interface/optionsmenu/tricontrolsbutton.png",
|
||||||
"hover" : "/interface/optionsmenu/tricontrolsbuttonhover.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,14 +362,15 @@ void Voice::mix(int16_t* buffer, size_t frameCount, unsigned channels) {
|
|||||||
VoiceAudioStream* audio = speaker->audioStream.get();
|
VoiceAudioStream* audio = speaker->audioStream.get();
|
||||||
MutexLocker audioLock(audio->mutex);
|
MutexLocker audioLock(audio->mutex);
|
||||||
if (speaker->playing && !audio->samples.empty()) {
|
if (speaker->playing && !audio->samples.empty()) {
|
||||||
if (!speaker->muted) {
|
|
||||||
mix = true;
|
|
||||||
for (size_t i = 0; i != samples; ++i)
|
for (size_t i = 0; i != samples; ++i)
|
||||||
speakerBuffer[i] = audio->take();
|
speakerBuffer[i] = audio->take();
|
||||||
|
|
||||||
if (speaker != m_clientSpeaker)
|
if (speaker != m_clientSpeaker)
|
||||||
speaker->decibelLevel = getAudioLoudness(speakerBuffer.data(), samples);
|
speaker->decibelLevel = getAudioLoudness(speakerBuffer.data(), samples);
|
||||||
|
|
||||||
|
if (!speaker->muted) {
|
||||||
|
mix = true;
|
||||||
|
|
||||||
float volume = speaker->volume;
|
float volume = speaker->volume;
|
||||||
Array2F levels = speaker->channelVolumes;
|
Array2F levels = speaker->channelVolumes;
|
||||||
for (size_t i = 0; i != samples; ++i)
|
for (size_t i = 0; i != samples; ++i)
|
||||||
@ -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;
|
++it;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user