Class: Groove::GrooveSink

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/groove/groove.rb

Overview

use this to get access to a realtime raw audio buffer for example you could use it to draw a waveform or other visualization GroovePlayer uses this internally to get the audio buffer for playback

Fields:

:audio_format

(GrooveAudioFormat) set this to the audio format you want the sink to output

:disable_resample

(Integer) Set this flag to ignore audio_format. If you set this flag, the buffers you pull from this sink could have any audio format.

:buffer_sample_count

(Integer) If you leave this to its default of 0, frames pulled from the sink will have sample count determined by efficiency. If you set this to a positive number, frames pulled from the sink will always have this number of samples.

:buffer_size

(Integer) how big the buffer queue should be, in sample frames. groove_sink_create defaults this to 8192

:gain

(Float) This volume adjustment only applies to this sink. It is recommended that you leave this at 1.0 and instead adjust the gain of the playlist. If you want to change this value after you have already attached the sink to the playlist, you must use groove_sink_set_gain. float format. Defaults to 1.0

:userdata

(FFI::Pointer(*Void)) set to whatever you want

:flush

(FFI::Pointer(*)) called when the audio queue is flushed. For example, if you seek to a different location in the song.

:purge

(FFI::Pointer(*)) called when a playlist item is deleted. Take this opportunity to remove all your references to the GroovePlaylistItem.

:pause

(FFI::Pointer(*)) called when the playlist is paused

:play

(FFI::Pointer(*)) called when the playlist is played

:playlist

(GroovePlaylist) read-only. set when you call groove_sink_attach. cleared when you call groove_sink_detach

:bytes_per_sec

(Integer) read-only. automatically computed from audio_format when you call groove_sink_attach