forked from len0rd/rockbox
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
This commit is contained in:
parent
746f01dd77
commit
1c635a8c3c
4 changed files with 20 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue