class AudioGlue::Template::HeadContext

The context in which the head statement of a .glue template is executed. It’s used to set the format, rate and channels on the template.

Public Class Methods

new(template) click to toggle source

@param template [Class] subclass of {AudioGlue::Template}

# File lib/audio_glue/template/head_context.rb, line 8
def initialize(template)
  @template = template
end

Public Instance Methods

channels(channels_value) click to toggle source

Set the number of channels on the template.

@param channels_value [Integer, String]

@return [void]

# File lib/audio_glue/template/head_context.rb, line 35
def channels(channels_value)
  @template.channels = channels_value
end
format(format_value) click to toggle source

Set the audio format on the template (“mp3”, “ogg”, “wav”, etc).

@param format_value [Symbol, String]

@return [void]

# File lib/audio_glue/template/head_context.rb, line 17
def format(format_value)
  @template.format = format_value
end
rate(rate_value) click to toggle source

Set the audio bitrate on the template.

@param rate_value [Integer, String]

@return [void]

# File lib/audio_glue/template/head_context.rb, line 26
def rate(rate_value)
  @template.rate = rate_value
end