Skip to content

Instantly share code, notes, and snippets.

@albanpeignier
Created May 18, 2009 09:18
Show Gist options
  • Save albanpeignier/113391 to your computer and use it in GitHub Desktop.
Save albanpeignier/113391 to your computer and use it in GitHub Desktop.
First preview of ALSA ruby binding
ALSA::PCM::Capture.open("hw:0", self.format(:sample_format => :s16_le)) do |capture|
capture.read do |buffer, frame_count|
self.sndfile.write buffer, frame_count
if frames_to_record
(frames_to_record -= frame_count) > 0
else
true
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment