[PATCH] Use maximal speed for speaking letters and tts_say.

Dmitri Paduchikh dpaduchikh на gmail.com
Ср Фев 6 12:42:37 MSK 2013


---
 daemon/core/TextProcessor.cpp | 8 +++-----
 daemon/main/main.cpp          | 2 +-
 emacspeak/LineParser.cpp      | 2 ++
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/daemon/core/TextProcessor.cpp b/daemon/core/TextProcessor.cpp
index 5235c57..21d0b5c 100644
--- a/daemon/core/TextProcessor.cpp
+++ b/daemon/core/TextProcessor.cpp
@@ -70,8 +70,6 @@ void TextProcessor::split(const std::wstring& text, TextItemList& items) const
 
 void TextProcessor::processLetter(wchar_t c, TextParam volume, TextParam pitch, TextParam rate, TextItemList& items) const
 {
-  TextParam faster = rate;
-  faster -= 10;
   LangId langId = LANG_ID_NONE;
   WCharToLangIdMap::const_iterator it = m_charsTable.find(c);
   if (it != m_charsTable.end())
@@ -84,7 +82,7 @@ void TextProcessor::processLetter(wchar_t c, TextParam volume, TextParam pitch,
     {
       WCharToWStringMap::const_iterator specialValueIt=m_specialValues.find(c);
       if (specialValueIt != m_specialValues.end())
-	process(TextItem(specialValueIt->second, volume, pitch, faster), items);
+	process(TextItem(specialValueIt->second, volume, pitch, rate), items);
       return;
     }
   const Lang* lang = getLangById(langId);
@@ -94,12 +92,12 @@ void TextProcessor::processLetter(wchar_t c, TextParam volume, TextParam pitch,
   WCharToWStringMap::const_iterator specialValueIt=m_specialValues.find(c);
   if (specialValueIt != m_specialValues.end())
     {
-      process(TextItem(specialValueIt->second, volume, p, faster), items);
+      process(TextItem(specialValueIt->second, volume, p, rate), items);
       return;
     }
   std::wstring s;
   s += c;
-  TextItem item(langId, s, volume, p, faster);
+  TextItem item(langId, s, volume, p, rate);
   item.mark(0);
   items.clear();
   items.push_back(item);
diff --git a/daemon/main/main.cpp b/daemon/main/main.cpp
index 16b2d33..f090dbf 100644
--- a/daemon/main/main.cpp
+++ b/daemon/main/main.cpp
@@ -211,7 +211,7 @@ public:
     logMsg(LOG_DEBUG, "Processing \'LETTER\' command with processor \'%s\'", client.selectedTextProcessor.c_str());
     //Preparing text item to provide into text processor;
     TextItemList textItemList;
-    textProc->processLetter(c, client.volume, client.pitch, client.rate, textItemList);
+    textProc->processLetter(c, client.volume, client.pitch, 0, textItemList);
     logMsg(LOG_DEBUG, "Text processor generated %u text items", textItemList.size());
     //OK, now we have the set of splitted items, but output information is omitted in it, only language specifications;
     TextItemList preparedTextItems;
diff --git a/emacspeak/LineParser.cpp b/emacspeak/LineParser.cpp
index ed3846c..ae6af64 100644
--- a/emacspeak/LineParser.cpp
+++ b/emacspeak/LineParser.cpp
@@ -175,7 +175,9 @@ void LineParser::tts_say(const std::string& s)
 	} //dectalk commands processing;
     } //while(s[i]);
   m_connection.stop();
+  m_connection.rate(0);
   m_connection.text(text);
+  m_connection.rate(m_rate);
 }
 
 void LineParser::tts_set_speech_rate(const std::string& s)
-- 
1.8.1.2


--=-=-=--


Подробная информация о списке рассылки Homeros