aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-rw-r--r--backends/text-to-speech/linux/linux-text-to-speech.cpp10
-rw-r--r--backends/text-to-speech/linux/linux-text-to-speech.h3
2 files changed, 9 insertions, 4 deletions
diff --git a/backends/text-to-speech/linux/linux-text-to-speech.cpp b/backends/text-to-speech/linux/linux-text-to-speech.cpp
index 7ddd4ac2b4..47c441a361 100644
--- a/backends/text-to-speech/linux/linux-text-to-speech.cpp
+++ b/backends/text-to-speech/linux/linux-text-to-speech.cpp
@@ -160,14 +160,18 @@ void LinuxTextToSpeechManager::setPitch(int pitch) {
_ttsState->_pitch = pitch;
}
-void LinuxTextToSpeechManager::setVolume(int volume) {
+void LinuxTextToSpeechManager::setVolume(unsigned volume) {
if (_speechState == BROKEN)
return;
- assert(volume >= -100 && volume <= 100);
- spd_set_volume(_connection, volume);
+ assert(volume <= 100);
+ spd_set_volume(_connection, (volume - 50) * 2);
_ttsState->_volume = volume;
}
+int LinuxTextToSpeechManager::getVolume() {
+ return (_ttsState->_volume - 50) * 2;
+}
+
void LinuxTextToSpeechManager::setLanguage(Common::String language) {
if (_speechState == BROKEN)
return;
diff --git a/backends/text-to-speech/linux/linux-text-to-speech.h b/backends/text-to-speech/linux/linux-text-to-speech.h
index 85f53eb2f8..faa6a9d468 100644
--- a/backends/text-to-speech/linux/linux-text-to-speech.h
+++ b/backends/text-to-speech/linux/linux-text-to-speech.h
@@ -58,7 +58,8 @@ public:
virtual void setPitch(int pitch);
- virtual void setVolume(int volume);
+ virtual void setVolume(unsigned volume);
+ virtual int getVolume();
virtual void setLanguage(Common::String language);