Class: Voicemaker::Commands::ProjectCommand

Inherits:
Base
  • Object
show all
Defined in:
lib/voicemaker/commands/project_command.rb

Instance Method Summary collapse

Methods inherited from Base

api_environment

Instance Method Details

#runObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/voicemaker/commands/project_command.rb', line 17

def run
  text_files.each do |file|
    text = File.read file
    tts.params.text = text
    audio_file = File.basename(file, '.txt') + ".#{tts.params.output_format}"
    output_path = "#{outdir}/#{audio_file}"

    say "in:  !txtblu!#{file}"
    say "url: !txtblu!#{tts.url}"
    say "out: !txtblu!#{output_path}"
    show_details tts if args['--debug']

    tts.save output_path
    say "---"
  end
end