Skip to content

Commit 5a822c0

Browse files
author
Kirill Belousov
committed
Removes some unneeded log entries which could potentially slow the program
1 parent 0437385 commit 5a822c0

2 files changed

Lines changed: 1 addition & 8 deletions

File tree

src/speech.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ Speech::Speech() {
1515
SRAL_Initialize(SRAL_ENGINE_NVDA | SRAL_ENGINE_JAWS | SRAL_ENGINE_UIA);
1616
spdlog::debug("SRAL initialized");
1717
}
18-
SRAL_GetEngineParameter(SRAL_ENGINE_SAPI, SRAL_PARAM_SPEECH_RATE, &m_defaultRate);
19-
spdlog::debug("Default speech rate: {}; default speech volume: {}", m_defaultRate, g_Audio.getVolume());
2018
}
2119

2220
Speech::~Speech() {
23-
spdlog::debug("SRAL destructor called");
21+
spdlog::debug("Uninitializing SRAL");
2422
if (SRAL_IsInitialized()) {
2523
SRAL_Uninitialize();
2624
spdlog::debug("SRAL uninitialized");
@@ -38,7 +36,6 @@ std::vector<std::string> Speech::getVoicesList() {
3836
spdlog::error("Failed to get voice count from SRAL.");
3937
return {}; // Return an empty vector on failure.
4038
}
41-
spdlog::debug("SRAL reports {} voices", voiceCount);
4239
if (voiceCount <= 0) {
4340
return {};
4441
}
@@ -64,7 +61,6 @@ bool Speech::speak(const char* text) {
6461
spdlog::warn("Trying to speak with unsupported voice");
6562
return false;
6663
}
67-
spdlog::trace("Speaking text: {}", text);
6864
uint64_t bufferSize;
6965
int channels;
7066
int sampleRate;
@@ -75,14 +71,12 @@ bool Speech::speak(const char* text) {
7571
}
7672

7773
bool Speech::setRate(uint64_t rate) {
78-
spdlog::trace("Setting rate to {}", rate);
7974
return SRAL_SetEngineParameter(SRAL_ENGINE_SAPI, SRAL_PARAM_SPEECH_RATE, &rate);
8075
}
8176

8277
bool Speech::setVoice(uint64_t idx) {
8378
m_unsupportedVoiceIsSet = std::find(m_unsupportedVoiceIndices.begin(), m_unsupportedVoiceIndices.end(), idx) !=
8479
m_unsupportedVoiceIndices.end();
85-
spdlog::trace("Setting voice ID to {}", idx);
8680
if (!SRAL_SetEngineParameter(SRAL_ENGINE_SAPI, SRAL_PARAM_VOICE_INDEX, &idx)) {
8781
spdlog::error("Failed to set voice index to {}", idx);
8882
return false;

src/ui.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ void MainFrame::populateVoicesList() {
7878
m_voicesList->AppendString("No voices available");
7979
}
8080
for (const auto& voiceName : voices) {
81-
spdlog::trace("Appending voice with name {}", voiceName);
8281
m_voicesList->AppendString(wxString::FromUTF8(voiceName));
8382
}
8483
m_voicesList->SetSelection(0);

0 commit comments

Comments
 (0)