class RSGuitarTech::VocalsExtractor

Attributes

opts[RW]
psarc[RW]
unpacked[RW]

Public Class Methods

new(opts) click to toggle source
# File lib/rsgt/vocals_extractor.rb, line 6
def initialize(opts)
  @psarc = File.expand_path(opts.delete :psarc)
  @opts  = opts
end

Public Instance Methods

extract!() click to toggle source
# File lib/rsgt/vocals_extractor.rb, line 11
def extract!
  puts ".. Extracting vocals from sng to xml..."
  UnpackedPSARC.from_psarc(psarc, opts) do |unpacked|
    CommandRunner.run! RSCustomSongToolkit.sng2xml(
      manifest: unpacked.manifest(:vocals),
      input:    unpacked.sng_bin(:vocals)
    )
    raise StandardError, "Failed to extract vocals" unless File.exist? unpacked.sng_xml

    FileUtils.cp unpacked.sng_xml, "."
  end
end