[PATCH] emacspeak: clamp out-of-range pitch values to be in 50..350
Dmitri Paduchikh
dpaduchikh на gmail.com
Пн Фев 18 14:20:28 MSK 2013
---
emacspeak/LineParser.cpp | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/emacspeak/LineParser.cpp b/emacspeak/LineParser.cpp
index ae6af64..b45d27a 100644
--- a/emacspeak/LineParser.cpp
+++ b/emacspeak/LineParser.cpp
@@ -61,9 +61,11 @@ void LineParser::processDectalkDefineVoice(StringDelimitedIterator<std::string>&
waitingAverPitch = 0;
if (!checkTypeUnsignedInt(s))
continue;
- const size_t value = parseAsUnsignedInt(s);
- if (value < 50 || value > 350)
- continue;
+ size_t value = parseAsUnsignedInt(s);
+ if (value < 50)
+ value = 50;
+ else if (value > 350)
+ value = 350;
pitch = (value - 50) / 3;
} //if(waitingAverPitch);
} //while();
--
1.8.1.4
Подробная информация о списке рассылки Homeros