Class: Loquendo
- Inherits:
-
Object
- Object
- Loquendo
- Defined in:
- lib/loquendo.rb,
lib/loquendo/version.rb
Defined Under Namespace
Classes: CommandNotFound, InvalidVoice
Constant Summary collapse
- VALID_VOICES =
[:fernanda, :ludoviko]
- VERSION =
'0.0.2'
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#command_dir ⇒ Object
Returns the value of attribute command_dir.
-
#sound_dir ⇒ Object
Returns the value of attribute sound_dir.
-
#sound_file ⇒ Object
Returns the value of attribute sound_file.
-
#voice ⇒ Object
Returns the value of attribute voice.
Class Method Summary collapse
Instance Method Summary collapse
- #command_path ⇒ Object
- #convert(string) ⇒ Object
- #convert_to_file(string) ⇒ Object
-
#initialize(opts = {}) ⇒ Loquendo
constructor
A new instance of Loquendo.
- #session ⇒ Object
- #session=(default_session) ⇒ Object
- #sound_path ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Loquendo
Returns a new instance of Loquendo.
13 14 15 16 17 18 19 20 |
# File 'lib/loquendo.rb', line 13 def initialize(opts = {}) @command_dir = opts[:command_dir] || '/opt/Loquendo/LTTS7/bin' @command = opts[:command] || 'SaveFile-alaw' @sound_dir = opts[:sound_dir] || Dir::tmpdir @sound_file = opts[:sound_file] || 'ltts' @voice = opts[:voice] || :fernanda self.session = opts[:session] || '/opt/Loquendo/LTTS7/bin/default.session' end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
8 9 10 |
# File 'lib/loquendo.rb', line 8 def command @command end |
#command_dir ⇒ Object
Returns the value of attribute command_dir.
8 9 10 |
# File 'lib/loquendo.rb', line 8 def command_dir @command_dir end |
#sound_dir ⇒ Object
Returns the value of attribute sound_dir.
8 9 10 |
# File 'lib/loquendo.rb', line 8 def sound_dir @sound_dir end |
#sound_file ⇒ Object
Returns the value of attribute sound_file.
8 9 10 |
# File 'lib/loquendo.rb', line 8 def sound_file @sound_file end |
#voice ⇒ Object
Returns the value of attribute voice.
8 9 10 |
# File 'lib/loquendo.rb', line 8 def voice @voice end |
Class Method Details
Instance Method Details
#command_path ⇒ Object
52 53 54 |
# File 'lib/loquendo.rb', line 52 def command_path command_dir + '/' + command end |
#convert(string) ⇒ Object
40 41 42 43 44 |
# File 'lib/loquendo.rb', line 40 def convert(string) check_for_command validate_voice _convert(string) end |
#convert_to_file(string) ⇒ Object
46 47 48 49 50 |
# File 'lib/loquendo.rb', line 46 def convert_to_file(string) check_for_command validate_voice _convert_to_file(string) end |
#session ⇒ Object
32 33 34 |
# File 'lib/loquendo.rb', line 32 def session ENV['LTTS7_DEFAULTSESSION'] end |
#session=(default_session) ⇒ Object
36 37 38 |
# File 'lib/loquendo.rb', line 36 def session=(default_session) ENV['LTTS7_DEFAULTSESSION'] = default_session end |
#sound_path ⇒ Object
56 57 58 |
# File 'lib/loquendo.rb', line 56 def sound_path sound_dir + '/' + sound_file end |