Class: RSGuitarTech::AudioExtractor
- Inherits:
-
Object
- Object
- RSGuitarTech::AudioExtractor
- Defined in:
- lib/rsgt/audio_extractor.rb
Instance Attribute Summary collapse
-
#opts ⇒ Object
Returns the value of attribute opts.
-
#psarc ⇒ Object
Returns the value of attribute psarc.
-
#unpacked ⇒ Object
Returns the value of attribute unpacked.
Instance Method Summary collapse
- #extract! ⇒ Object
-
#initialize(opts) ⇒ AudioExtractor
constructor
A new instance of AudioExtractor.
Constructor Details
#initialize(opts) ⇒ AudioExtractor
Returns a new instance of AudioExtractor.
6 7 8 9 |
# File 'lib/rsgt/audio_extractor.rb', line 6 def initialize(opts) @psarc = File.(opts.delete :psarc) @opts = opts end |
Instance Attribute Details
#opts ⇒ Object
Returns the value of attribute opts.
4 5 6 |
# File 'lib/rsgt/audio_extractor.rb', line 4 def opts @opts end |
#psarc ⇒ Object
Returns the value of attribute psarc.
4 5 6 |
# File 'lib/rsgt/audio_extractor.rb', line 4 def psarc @psarc end |
#unpacked ⇒ Object
Returns the value of attribute unpacked.
4 5 6 |
# File 'lib/rsgt/audio_extractor.rb', line 4 def unpacked @unpacked end |
Instance Method Details
#extract! ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rsgt/audio_extractor.rb', line 11 def extract! UnpackedPSARC.from_psarc(psarc, opts) do |unpacked| # Convert main track from wem to ogg: CommandRunner.run! RSCustomSongToolkit.ww2ogg(unpacked.audio_track) raise StandardError unless File.exist?(unpacked.ogg_track) # Revorb it so it doesn't sound bad... CommandRunner.run! RSCustomSongToolkit.revorb(unpacked.ogg_track) FileUtils.cp unpacked.ogg_track, "output.ogg" end end |