Class: Typecast::Models::Output

Inherits:
Object
  • Object
show all
Defined in:
lib/typecast/models.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(volume: nil, target_lufs: nil, audio_pitch: nil, audio_tempo: nil, audio_format: nil, remove_silence_ms: nil) ⇒ Output

Returns a new instance of Output.



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/typecast/models.rb', line 18

def initialize(volume: nil, target_lufs: nil, audio_pitch: nil, audio_tempo: nil, audio_format: nil, remove_silence_ms: nil)
  unless remove_silence_ms.nil? || (remove_silence_ms.is_a?(Integer) && (0..1000).cover?(remove_silence_ms))
    raise ArgumentError, "remove_silence_ms must be an integer between 0 and 1000"
  end
  @remove_silence_ms = remove_silence_ms
  @volume = volume
  @target_lufs = target_lufs
  @audio_pitch = audio_pitch
  @audio_tempo = audio_tempo
  @audio_format = audio_format
end

Instance Attribute Details

#audio_format ⇒ Object (readonly)

Returns the value of attribute audio_format.



16
17
18
# File 'lib/typecast/models.rb', line 16

def audio_format
  @audio_format
end

#audio_pitch ⇒ Object (readonly)

Returns the value of attribute audio_pitch.



16
17
18
# File 'lib/typecast/models.rb', line 16

def audio_pitch
  @audio_pitch
end

#audio_tempo ⇒ Object (readonly)

Returns the value of attribute audio_tempo.



16
17
18
# File 'lib/typecast/models.rb', line 16

def audio_tempo
  @audio_tempo
end

#remove_silence_ms ⇒ Object (readonly)

Returns the value of attribute remove_silence_ms.



16
17
18
# File 'lib/typecast/models.rb', line 16

def remove_silence_ms
  @remove_silence_ms
end

#target_lufs ⇒ Object (readonly)

Returns the value of attribute target_lufs.



16
17
18
# File 'lib/typecast/models.rb', line 16

def target_lufs
  @target_lufs
end

#volume ⇒ Object (readonly)

Returns the value of attribute volume.



16
17
18
# File 'lib/typecast/models.rb', line 16

def volume
  @volume
end

Instance Method Details

#to_h ⇒ Object



30
31
32
33
34
35
36
37
38
39
# File 'lib/typecast/models.rb', line 30

def to_h
  Models.compact(
    volume: volume,
    remove_silence_ms: remove_silence_ms,
    target_lufs: target_lufs,
    audio_pitch: audio_pitch,
    audio_tempo: audio_tempo,
    audio_format: audio_format
  )
end