Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend/StarVoice.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-07-19 19:06:53 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-07-19 19:06:53 +1000
commit0c1c3611b1b1c1b17efac547ad08a6821f3b8f01 (patch)
tree02754061b14bffac73b4f809b976e6ba92e3061d /source/frontend/StarVoice.cpp
parent620c23e70a455bc0d7b0af3a279ca8bd3ec1488d (diff)
Save loopback setting
Diffstat (limited to 'source/frontend/StarVoice.cpp')
-rw-r--r--source/frontend/StarVoice.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/frontend/StarVoice.cpp b/source/frontend/StarVoice.cpp
index d553fa1..a4641ab 100644
--- a/source/frontend/StarVoice.cpp
+++ b/source/frontend/StarVoice.cpp
@@ -186,7 +186,7 @@ void Voice::loadJson(Json const& config, bool skipSave) {
m_inputVolume = config.getFloat("inputVolume", m_inputVolume);
m_outputVolume = config.getFloat("outputVolume", m_outputVolume);
- if (change(m_loopBack, config.getBool("loopBack", m_loopBack), changed))
+ if (change(m_loopback, config.getBool("loopback", m_loopback), changed))
m_clientSpeaker->playing = false;
if (auto inputMode = config.optString("inputMode")) {
@@ -218,6 +218,7 @@ Json Voice::saveJson() const {
{"outputVolume", m_outputVolume},
{"inputMode", VoiceInputModeNames.getRight(m_inputMode)},
{"channelMode", VoiceChannelModeNames.getRight(m_channelMode)},
+ {"loopback", m_loopback},
{"version", 1}
};
}
@@ -293,7 +294,7 @@ void Voice::readAudioData(uint8_t* stream, int len) {
}
}
- if (!m_loopBack) {
+ if (!m_loopback) {
if (active && !m_clientSpeaker->playing)
m_clientSpeaker->lastPlayTime = now;
@@ -463,7 +464,7 @@ int Voice::send(DataStreamBuffer& out, size_t budget) {
}
m_lastSentTime = Time::monotonicMilliseconds();
- if (m_loopBack)
+ if (m_loopback)
receive(m_clientSpeaker, { out.ptr(), out.size() });
return 1;
}
@@ -652,7 +653,7 @@ void Voice::thread() {
samples[i] *= m_inputVolume;
}
- if (!m_loopBack)
+ if (!m_loopback)
m_clientSpeaker->decibelLevel = getAudioLoudness(samples.data(), samples.size());
if (int encodedSize = opus_encode(m_encoder.get(), samples.data(), VOICE_FRAME_SIZE, (unsigned char*)encoded.ptr(), encoded.size())) {