Class: AudioGlue::SnippetPacket

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/audio_glue/snippet_packet.rb

Overview

SnippetPacket is a collection of snippets with some additional info about the output file (format, rate, number of channels).

It’s supposed to be built by Template. And then it’s passed to an adapter which builds the audio output.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(format, rate, channels) ⇒ SnippetPacket

Returns a new instance of SnippetPacket.

Parameters:

  • format (Symbol, String)
  • rate (Numeric, String)
  • channels (Numeric, String)


18
19
20
21
22
23
# File 'lib/audio_glue/snippet_packet.rb', line 18

def initialize(format, rate, channels)
  @format   = format
  @rate     = rate
  @channels = channels
  @snippets = []
end

Instance Attribute Details

#channelsObject

Returns the value of attribute channels.



12
13
14
# File 'lib/audio_glue/snippet_packet.rb', line 12

def channels
  @channels
end

#formatObject

Returns the value of attribute format.



12
13
14
# File 'lib/audio_glue/snippet_packet.rb', line 12

def format
  @format
end

#rateObject

Returns the value of attribute rate.



12
13
14
# File 'lib/audio_glue/snippet_packet.rb', line 12

def rate
  @rate
end

#snippetsObject (readonly)

Returns the value of attribute snippets.



13
14
15
# File 'lib/audio_glue/snippet_packet.rb', line 13

def snippets
  @snippets
end