Class: Audiomator::Options
- Inherits:
-
Struct
- Object
- Struct
- Audiomator::Options
- Defined in:
- lib/audiomator/options.rb
Overview
Options which convert audio to
Instance Attribute Summary collapse
-
#bitrate ⇒ Object
Returns the value of attribute bitrate.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#sample_rate ⇒ Object
Returns the value of attribute sample_rate.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
Instance Method Summary collapse
-
#initialize(start_time, end_time, bitrate = '96k', sample_rate = '44100', metadata = {}) ⇒ Options
constructor
A new instance of Options.
-
#metadata_string ⇒ Object
see multimedia.cx/eggs/supplying-ffmpeg-with-metadata/ for metadata.
- #to_s ⇒ Object
Constructor Details
#initialize(start_time, end_time, bitrate = '96k', sample_rate = '44100', metadata = {}) ⇒ Options
Returns a new instance of Options.
6 7 8 |
# File 'lib/audiomator/options.rb', line 6 def initialize(start_time, end_time, bitrate = '96k', sample_rate = '44100', = {}) super end |
Instance Attribute Details
#bitrate ⇒ Object
Returns the value of attribute bitrate
4 5 6 |
# File 'lib/audiomator/options.rb', line 4 def bitrate @bitrate end |
#end_time ⇒ Object
Returns the value of attribute end_time
4 5 6 |
# File 'lib/audiomator/options.rb', line 4 def end_time @end_time end |
#metadata ⇒ Object
Returns the value of attribute metadata
4 5 6 |
# File 'lib/audiomator/options.rb', line 4 def @metadata end |
#sample_rate ⇒ Object
Returns the value of attribute sample_rate
4 5 6 |
# File 'lib/audiomator/options.rb', line 4 def sample_rate @sample_rate end |
#start_time ⇒ Object
Returns the value of attribute start_time
4 5 6 |
# File 'lib/audiomator/options.rb', line 4 def start_time @start_time end |
Instance Method Details
#metadata_string ⇒ Object
see multimedia.cx/eggs/supplying-ffmpeg-with-metadata/ for metadata
11 12 13 14 |
# File 'lib/audiomator/options.rb', line 11 def return '' if .empty? .map { |k, v| "-metadata #{k}=#{Shellwords.escape(v)}" }.join(' ') end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/audiomator/options.rb', line 16 def to_s "-b:a #{bitrate} -ar #{sample_rate} -ss #{start_time} -to #{end_time} #{}" end |