@@ -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
2220Speech::~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
7773bool 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
8277bool 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 ;
0 commit comments