Sha256: ac329ee654470500cdc9783647b1316d84a38e1a44c5fc41897cd278cb3d6905

Contents?: true

Size: 643 Bytes

Versions: 15

Compression:

Stored size: 643 Bytes

Contents

#
# Implementes AudioStream Interface for libAV
#

# AudioStream = Struct.new(:codec, :channels, :channel_layout, :sample_rate, :bit_rate, :raw)
module VCSRuby
  class LibAVAudioStream
    attr_reader :raw

    def initialize audio_stream
      @raw = audio_stream
    end

    def codec short = false
      if short
        @raw['codec_name']
      else
        @raw['codec_long_name']
      end
    end

    def channels
      @raw['channels'].to_i
    end

    def channel_layout
      @raw['channel_layout']
    end

    def sample_rate
      @raw['sample_rate'].to_i
    end

    def bit_rate
      @raw['bit_rate'].to_i
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
vcs_ruby-1.1.16 lib/libAV/libav_audio_stream.rb
vcs_ruby-1.1.15 lib/libAV/libav_audio_stream.rb
vcs_ruby-1.1.14 lib/libAV/libav_audio_stream.rb
vcs_ruby-1.1.13 lib/libAV/libav_audio_stream.rb
vcs_ruby-1.1.12 lib/libAV/libav_audio_stream.rb
vcs_ruby-1.1.11 lib/libAV/libav_audio_stream.rb
vcs_ruby-1.1.10 lib/libAV/libav_audio_stream.rb
vcs_ruby-1.1.8 lib/libAV/libav_audio_stream.rb
vcs_ruby-1.1.7 lib/libAV/libav_audio_stream.rb
vcs_ruby-1.1.6 lib/libAV/libav_audio_stream.rb
vcs_ruby-1.1.5 lib/libAV/libav_audio_stream.rb
vcs_ruby-1.1.4 lib/libAV/libav_audio_stream.rb
vcs_ruby-1.1.3 lib/libAV/libav_audio_stream.rb
vcs_ruby-1.1.2 lib/libAV/libav_audio_stream.rb
vcs_ruby-1.1.0 lib/libAV/libav_audio_stream.rb