An audio driver for Hallon, a ruby client for libspotify. Streams audio into a ruby Queue, allowing your code to work directly with audio samples out of Hallon. One sample is an arrays of signed 16-bit integers, one for each channel.
$ gem install hallon-queue-output
Initialize a Hallon player and pass QueueOutput as the driver. Pass a &block
as the second argument to set queue the driver should push into. (the block runs after Hallon creates the driver, where you would normally establish callbacks):
# After loading Hallon and creating a session...
require 'thread'
require 'hallon-queue-output'
my_queue = Queue.new
player = Hallon::Player.new Hallon::QueueOutput, Proc.new do
@driver.queue = my_queue
end
##TODO
- Support changes in format. Right now, playing a track not at 44.1khz will produce no output.