Class: Audio::LiveOutput

Inherits:
LiveOutputC show all
Defined in:
ext/audio/output.c,
lib/audio/output.rb

Overview

オーディオデバイス出力機能をサポートするクラス。

Defined Under Namespace

Classes: BadOption, DeviceError, DriverError, Error, NoDriver, NotFile, NotLive, UnknownError

Instance Method Summary collapse

Methods inherited from LiveOutputC

#close, #closed?, #play, #playing?, #waiting

Constructor Details

#initialize(driver_id: Audio::Info.default_driver_id, bits: 16, rate: 44100, channels: 2, byte_format: Audio::Info::FMT_NATIVE, matrix: nil, options: nil, thread: nil) ⇒ LiveOutput

Returns a new instance of LiveOutput.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/audio/output.rb', line 6

def initialize(
      driver_id:
        Audio::Info.default_driver_id,
      bits: 16, rate: 44100, channels: 2,
      byte_format:
        Audio::Info::FMT_NATIVE,
      matrix: nil, options: nil, thread: nil)
  ao = super(driver_id, bits, rate, channels,
             byte_format, matrix, options)
  if block_given?
    begin
      yield ao
    ensure
      ao.close
    end
  end
end