Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 48 lines (31 sloc) 1.217 kb
bc4ea74 @wedesoft Added README.md
authored
1 hornetseye-alsa
4d17470 @wedesoft Added more documentation
authored
2 ===============
3
4 **Author**: Jan Wedekind
c0e05b3 @wedesoft Got ALSA output working with new Linux version
authored
5 **Copyright**: 2012
4d17470 @wedesoft Added more documentation
authored
6 **License**: GPL
7
8 Synopsis
9 --------
10
3f372ce @wedesoft Minor change
authored
11 This Ruby extension provides an interface for playing and recording audio data using the Advanced Linux Sound Architecture (ALSA).
bc4ea74 @wedesoft Added README.md
authored
12
4d17470 @wedesoft Added more documentation
authored
13 Installation
14 ------------
2aed0d5 @wedesoft Minor changes to documentation
authored
15
6a52ef9 @wedesoft Working on documentation
authored
16 *hornetseye-alsa* requires the ALSA library. If you are running Debian or (K)ubuntu, you can install it like this:
4d17470 @wedesoft Added more documentation
authored
17
53c49ad @wedesoft Updated README with dependencies
authored
18 $ sudo aptitude install libasound2-dev libboost-dev libboost-dev
25e569f @wedesoft Working on documentation
authored
19
6a52ef9 @wedesoft Working on documentation
authored
20 To install this Ruby extension, use the following command:
4d17470 @wedesoft Added more documentation
authored
21
22 $ sudo gem install hornetseye-alsa
23
25e569f @wedesoft Working on documentation
authored
24 Alternatively you can build and install the Ruby extension from source as follows:
4d17470 @wedesoft Added more documentation
authored
25
26 $ rake
27 $ sudo rake install
28
29 Usage
30 -----
31
32 Simply run Interactive Ruby:
33
34 $ irb
35
6a52ef9 @wedesoft Working on documentation
authored
36 You can load and use ALSA as shown below. This example will open microphone and speakers and then write the input of the microphone to the speakers.
4d17470 @wedesoft Added more documentation
authored
37
38 require 'rubygems'
39 require 'hornetseye_alsa'
40 include Hornetseye
41 microphone = AlsaInput.new 'default:0' # or 'default:1' for USB microphone
42 speaker = AlsaOutput.new 'default:0', microphone.rate, microphone.channels
43 while true
44 frame = microphone.read 1024
45 speaker.write frame
46 end
47
Something went wrong with that request. Please try again.