Class: MusicMaster::Formats::MP3

Inherits:
Object
  • Object
show all
Defined in:
lib/MusicMaster/Formats/MP3.rb

Instance Method Summary collapse

Instance Method Details

#deliver(iSrcFileName, iDstFileName, iFormatConf, iMetadata) ⇒ Object

Deliver a file. The delivered file can be a shortcut to the source one.

Parameters
  • iSrcFileName (String): The source file to deliver from

  • iDstFileName (String): The destination file to be delivered

  • iFormatConf (map<Symbol,Object>): The format configuration

  • iMetadata (map<Symbol,Object>): The metadata that can be used while delivering the file



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/MusicMaster/Formats/MP3.rb', line 28

def deliver(iSrcFileName, iDstFileName, iFormatConf, )
  # TODO: Implement it using an external tool, and make regression testing
  lTranslatedParams = []
  iParams.each do |iParam, iValue|
    case iParam
    when :SampleRate
      lTranslatedParams << "Sample rate: #{iValue} Hz"
    when :BitRate
      lTranslatedParams << "Bit rate: #{iValue} kbps"
    else
      log_warn "Unknown MP3 format parameter: #{iParam} (value #{iValue.inspect}). Ignoring it."
    end
  end
  puts "Convert file #{iSrcFileName} into file #{iDstFileName} in MP3 format with following parameters: #{lTranslatedParams.join(', ')}"
  puts 'Press Enter when done.'
  $stdin.gets
end

#getFileExtObject

Give the file extension

Return
  • String: The file extension (without .)



16
17
18
# File 'lib/MusicMaster/Formats/MP3.rb', line 16

def getFileExt
  return 'mp3'
end