Class: Discorb::Voice::OggAudio

Inherits:
Object
  • Object
show all
Defined in:
lib/discorb/voice/source.rb

Overview

Plays audio from a ogg file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(src) ⇒ OggAudio

Opens an ogg file.

Parameters:

  • src (String, IO)

    The ogg file to open, or an IO object.



104
105
106
107
108
109
110
# File 'lib/discorb/voice/source.rb', line 104

def initialize(src)
  @io = if src.is_a?(String)
      File.open(src, "rb")
    else
      src
    end
end

Instance Attribute Details

#ioObject (readonly)

Returns the value of attribute io.



97
98
99
# File 'lib/discorb/voice/source.rb', line 97

def io
  @io
end