mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
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
|
|
@ -46,6 +46,7 @@ const static struct {
|
||||||
{ RbSettings::VoiceLanguage, "voicelanguage", "" },
|
{ RbSettings::VoiceLanguage, "voicelanguage", "" },
|
||||||
{ RbSettings::TtsLanguage, ":tts:/language", "" },
|
{ RbSettings::TtsLanguage, ":tts:/language", "" },
|
||||||
{ RbSettings::TtsOptions, ":tts:/options", "" },
|
{ RbSettings::TtsOptions, ":tts:/options", "" },
|
||||||
|
{ RbSettings::TtsPitch, ":tts:/pitch", "0" },
|
||||||
{ RbSettings::TtsPath, ":tts:/path", "" },
|
{ RbSettings::TtsPath, ":tts:/path", "" },
|
||||||
{ RbSettings::TtsVoice, ":tts:/voice", "" },
|
{ RbSettings::TtsVoice, ":tts:/voice", "" },
|
||||||
{ RbSettings::EncoderPath, ":encoder:/encoderpath", "" },
|
{ RbSettings::EncoderPath, ":encoder:/encoderpath", "" },
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ class RbSettings : public QObject
|
||||||
TtsOptions,
|
TtsOptions,
|
||||||
TtsPath,
|
TtsPath,
|
||||||
TtsVoice,
|
TtsVoice,
|
||||||
|
TtsPitch,
|
||||||
EncoderPath,
|
EncoderPath,
|
||||||
EncoderOptions,
|
EncoderOptions,
|
||||||
WavtrimThreshold,
|
WavtrimThreshold,
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,12 @@ bool TTSCarbon::start(QString *errStr)
|
||||||
RbSettings::TtsSpeed).toInt());
|
RbSettings::TtsSpeed).toInt());
|
||||||
if(rate != 0)
|
if(rate != 0)
|
||||||
SetSpeechRate(m_channel, rate);
|
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;
|
return (error == 0) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -139,6 +145,14 @@ void TTSCarbon::generateSettings(void)
|
||||||
tr("Speed (words/min):"), speed, 80, 500,
|
tr("Speed (words/min):"), speed, 80, 500,
|
||||||
EncTtsSetting::eNOBTN);
|
EncTtsSetting::eNOBTN);
|
||||||
insertSetting(ConfigSpeed, setting);
|
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());
|
getSetting(ConfigVoice)->current().toString());
|
||||||
RbSettings::setSubValue("carbon", RbSettings::TtsSpeed,
|
RbSettings::setSubValue("carbon", RbSettings::TtsSpeed,
|
||||||
getSetting(ConfigSpeed)->current().toInt());
|
getSetting(ConfigSpeed)->current().toInt());
|
||||||
|
RbSettings::setSubValue("carbon", RbSettings::TtsPitch,
|
||||||
|
getSetting(ConfigPitch)->current().toInt());
|
||||||
RbSettings::sync();
|
RbSettings::sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,8 @@ class TTSCarbon : public TTSBase
|
||||||
enum ConfigValuesCarbon
|
enum ConfigValuesCarbon
|
||||||
{
|
{
|
||||||
ConfigVoice,
|
ConfigVoice,
|
||||||
ConfigSpeed
|
ConfigSpeed,
|
||||||
|
ConfigPitch
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
TTSCarbon(QObject *parent = NULL);
|
TTSCarbon(QObject *parent = NULL);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue