Class: PlaySolder::MP3
Constant Summary collapse
- EXTENSIONS =
[ ".mp3" ]
Instance Attribute Summary
Attributes inherited from Fake
Instance Method Summary collapse
Methods inherited from Fake
#escaped_faked_file, #extension, #faked_file, for_path, #initialize, #text
Constructor Details
This class inherits a constructor from PlaySolder::Fake
Instance Method Details
#generate ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/play_solder/mp3.rb', line 5 def generate return faked_file if File.exist?(faked_file) aiff = faked_file.gsub(extension, ".aiff") cmd = %Q{ say -v Vicki "#{ text }" -o "#{ aiff }"; } cmd += %Q{ sox "#{ aiff }" "#{ faked_file }"; } system(cmd) faked_file end |
#mime_type ⇒ Object
15 16 17 |
# File 'lib/play_solder/mp3.rb', line 15 def mime_type "application/mp3" end |