Module
Snack::Audio
In: rbSnack/tkSnack.rb

This module offers functions that control various aspects of the audio devices.

Methods

encodings, inputDevices, outputDevices, pause, play, playLatency, playLatency=, play_gain, play_gain=, rates, sa, selectInput, selectOutput, stop,
Public Instance methods
sa(txt) src

A private helper method for snack::audio

encodings() src

Returns a list of supported sample encoding formats for the currently selected device

rates() src

Returns a list of supported sample rates for the currently selected device. Is synomous with frequencies

inputDevices() src

Returns a list of available audio input devices

playLatency() src

Returns the number of millseconds for which sound may be queued up for playback

playLatency=(latency) src

Sets or assigns the number of millseconds for which sound may be queued up for playback. The lower the value, quicker a new sound is dispatched to the speakers. However, if the value is too low, and your processor is slow or the load is high, gaps in the output may occur.

pause() src

Toggles between play and pause for all playback on the audio device.

play() src

Resumes paused playback on the audio device.

play_gain() src

Returns the current output gain

play_gain=(gain;) src

Sets the current output gain. The valid range for the gain is between 0 and 100

outputDevices() src

Returns a list of available audio output devices.

selectOutput(device;) src

Selects the default audio output device.

selectInput(device;) src

Selects the default audio input device.

stop() src

Stops all playback on the audio device.