Module: Flite
- Defined in:
- lib/flite.rb,
lib/flite/version.rb,
ext/flite/rbflite.c
Defined Under Namespace
Classes: Error, RuntimeError, Voice
Constant Summary collapse
Class Method Summary collapse
-
.default_voice ⇒ Flite::Voice
Returns the voice used by String#speak and String#to_speech.
-
.default_voice=(name) ⇒ Object
Set the voice used by String#speak and String#to_speech.
-
.list_builtin_voices ⇒ Array
Returns builtin voice names.
-
.sleep_time_after_speaking=(sec) ⇒ Object
Sets sleep time after Voice#speak.
-
.supported_audio_types ⇒ Array
Returns supported audio types used as the second argument of Voice#to_speech.
Class Method Details
.default_voice ⇒ Flite::Voice
Returns the voice used by String#speak and String#to_speech.
45 46 47 |
# File 'lib/flite.rb', line 45 def self.default_voice @@default_voice end |
.default_voice=(name) ⇒ Object
Set the voice used by String#speak and String#to_speech. When name
is a Voice, use it. Otherwise, use a new voice created by Flite::Voice.new(name)
.
55 56 57 58 59 60 61 |
# File 'lib/flite.rb', line 55 def self.default_voice=(name) if name.is_a? Flite::Voice @@default_voice = name else @@default_voice = Flite::Voice.new(name) end end |
.list_builtin_voices ⇒ Array
Returns builtin voice names.
253 254 255 256 257 258 259 260 261 262 263 264 265 |
# File 'ext/flite/rbflite.c', line 253
static VALUE
flite_s_list_builtin_voices(VALUE klass)
{
VALUE ary = rb_ary_new();
const rbflite_builtin_voice_t *builtin = rbflite_builtin_voice_list;
while (builtin->name != NULL) {
rb_ary_push(ary, rb_usascii_str_new_cstr(builtin->name));
builtin++;
}
return ary;
}
|
.sleep_time_after_speaking=(sec) ⇒ Object
307 308 309 310 311 312 |
# File 'ext/flite/rbflite.c', line 307
static VALUE
flite_s_set_sleep_time_after_speaking(VALUE klass, VALUE val)
{
sleep_time_after_speaking = rb_time_interval(val);
return val;
}
|
.supported_audio_types ⇒ Array
Returns supported audio types used as the second argument of Flite::Voice#to_speech.
279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'ext/flite/rbflite.c', line 279
static VALUE
flite_s_supported_audio_types(VALUE klass)
{
VALUE ary = rb_ary_new();
rb_ary_push(ary, sym_wav);
rb_ary_push(ary, sym_raw);
#ifdef HAVE_MP3LAME
rb_ary_push(ary, sym_mp3);
#endif
return ary;
}
|