Class: PlaySolder::MP3

Inherits:
Fake
  • Object
show all
Defined in:
lib/play_solder/mp3.rb

Constant Summary collapse

EXTENSIONS =
[ ".mp3" ]

Instance Attribute Summary

Attributes inherited from Fake

#path

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

#generateObject



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_typeObject



15
16
17
# File 'lib/play_solder/mp3.rb', line 15

def mime_type
  "application/mp3"
end