Skip to content

Instantly share code, notes, and snippets.

@takkkun
Created September 15, 2011 14:38
Show Gist options
  • Save takkkun/1219407 to your computer and use it in GitHub Desktop.
Save takkkun/1219407 to your computer and use it in GitHub Desktop.
require 'optparse'
require 'open3'
voice = 'bells'
ARGV.options do |opt|
opt.on('-v VAL', '--voice=VAL') {|v| voice = v}
opt.parse!
end
Open3.popen3 "say -v #{voice}" do |stdin, stdout, stderr|
stdout.close
stderr.close
ARGV.each {|path| stdin.puts File.read path}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment