summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2011-04-03 09:23:21 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2011-04-03 09:23:21 +0000
commit1c635a8c3c49c1c657b5c387d53086da5d6c08d3 (patch)
tree03252d5277fa2ba9c0a1cfa5dfb425e72196a4f6
parent746f01dd775feb9b53577a2338fd9182d879c0d3 (diff)
downloadrockbox-1c635a8c3c49c1c657b5c387d53086da5d6c08d3.tar.gz
rockbox-1c635a8c3c49c1c657b5c387d53086da5d6c08d3.zip
OS X TTS: add pitch setting.
The current TTS configuration doesn't allow querying the system values so it currently can't be displayed. A value of 0 will use the system default. The default pitch is dependent on the voice; most voices should have a default pitch of 45 - 55. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29673 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/rbutilqt/base/rbsettings.cpp1
-rw-r--r--rbutil/rbutilqt/base/rbsettings.h1
-rw-r--r--rbutil/rbutilqt/base/ttscarbon.cpp16
-rw-r--r--rbutil/rbutilqt/base/ttscarbon.h3
4 files changed, 20 insertions, 1 deletions
diff --git a/rbutil/rbutilqt/base/rbsettings.cpp b/rbutil/rbutilqt/base/rbsettings.cpp
index c6f1bfcf6b..4026fb5ee9 100644
--- a/rbutil/rbutilqt/base/rbsettings.cpp
+++ b/rbutil/rbutilqt/base/rbsettings.cpp
@@ -46,6 +46,7 @@ const static struct {
{ RbSettings::VoiceLanguage, "voicelanguage", "" },
{ RbSettings::TtsLanguage, ":tts:/language", "" },
{ RbSettings::TtsOptions, ":tts:/options", "" },
+ { RbSettings::TtsPitch, ":tts:/pitch", "0" },
{ RbSettings::TtsPath, ":tts:/path", "" },
{ RbSettings::TtsVoice, ":tts:/voice", "" },
{ RbSettings::EncoderPath, ":encoder:/encoderpath", "" },
diff --git a/rbutil/rbutilqt/base/rbsettings.h b/rbutil/rbutilqt/base/rbsettings.h
index d66a01d3e2..277b2197d1 100644
--- a/rbutil/rbutilqt/base/rbsettings.h
+++ b/rbutil/rbutilqt/base/rbsettings.h
@@ -48,6 +48,7 @@ class RbSettings : public QObject
TtsOptions,
TtsPath,
TtsVoice,
+ TtsPitch,
EncoderPath,
EncoderOptions,
WavtrimThreshold,
diff --git a/rbutil/rbutilqt/base/ttscarbon.cpp b/rbutil/rbutilqt/base/ttscarbon.cpp
index ba744b5fcf..96a9bf6852 100644
--- a/rbutil/rbutilqt/base/ttscarbon.cpp
+++ b/rbutil/rbutilqt/base/ttscarbon.cpp
@@ -89,6 +89,12 @@ bool TTSCarbon::start(QString *errStr)
RbSettings::TtsSpeed).toInt());
if(rate != 0)
SetSpeechRate(m_channel, rate);
+
+ Fixed pitch = (Fixed)(0x10000 * RbSettings::subValue("carbon",
+ RbSettings::TtsPitch).toInt());
+ if(pitch != 0)
+ SetSpeechPitch(m_channel, pitch);
+
return (error == 0) ? true : false;
}
@@ -139,6 +145,14 @@ void TTSCarbon::generateSettings(void)
tr("Speed (words/min):"), speed, 80, 500,
EncTtsSetting::eNOBTN);
insertSetting(ConfigSpeed, setting);
+
+ // pitch
+ int pitch = RbSettings::subValue("carbon", RbSettings::TtsPitch).toInt();
+ setting = new EncTtsSetting(this, EncTtsSetting::eINT,
+ tr("Pitch (0 for default):"), pitch, 0, 65,
+ EncTtsSetting::eNOBTN);
+ insertSetting(ConfigPitch, setting);
+
}
@@ -149,6 +163,8 @@ void TTSCarbon::saveSettings(void)
getSetting(ConfigVoice)->current().toString());
RbSettings::setSubValue("carbon", RbSettings::TtsSpeed,
getSetting(ConfigSpeed)->current().toInt());
+ RbSettings::setSubValue("carbon", RbSettings::TtsPitch,
+ getSetting(ConfigPitch)->current().toInt());
RbSettings::sync();
}
diff --git a/rbutil/rbutilqt/base/ttscarbon.h b/rbutil/rbutilqt/base/ttscarbon.h
index fd5f84849b..be7590240a 100644
--- a/rbutil/rbutilqt/base/ttscarbon.h
+++ b/rbutil/rbutilqt/base/ttscarbon.h
@@ -33,7 +33,8 @@ class TTSCarbon : public TTSBase
enum ConfigValuesCarbon
{
ConfigVoice,
- ConfigSpeed
+ ConfigSpeed,
+ ConfigPitch
};
public:
TTSCarbon(QObject *parent = NULL);