hornetseye-alsa 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +41 -1
- data/Rakefile +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -1,4 +1,44 @@
|
|
1
1
|
hornetseye-alsa
|
2
|
-
|
2
|
+
===============
|
3
|
+
|
4
|
+
**Author**: Jan Wedekind
|
5
|
+
**Copyright**: 2010
|
6
|
+
**License**: GPL
|
7
|
+
|
8
|
+
Synopsis
|
9
|
+
--------
|
10
|
+
|
3
11
|
This Ruby extension provides an interface for playing audio data using ALSA.
|
4
12
|
|
13
|
+
Installation
|
14
|
+
------------
|
15
|
+
|
16
|
+
To install the Hornetseye ALSA bindings, use the following command:
|
17
|
+
|
18
|
+
$ sudo gem install hornetseye-alsa
|
19
|
+
|
20
|
+
You can install from source as follows:
|
21
|
+
|
22
|
+
$ rake
|
23
|
+
$ sudo rake install
|
24
|
+
|
25
|
+
Usage
|
26
|
+
-----
|
27
|
+
|
28
|
+
Simply run Interactive Ruby:
|
29
|
+
|
30
|
+
$ irb
|
31
|
+
|
32
|
+
You can load and use ALSA as shown below. This example will open microphone and
|
33
|
+
speakers and then write the input of the microphone to the speakers.
|
34
|
+
|
35
|
+
require 'rubygems'
|
36
|
+
require 'hornetseye_alsa'
|
37
|
+
include Hornetseye
|
38
|
+
microphone = AlsaInput.new 'default:0' # or 'default:1' for USB microphone
|
39
|
+
speaker = AlsaOutput.new 'default:0', microphone.rate, microphone.channels
|
40
|
+
while true
|
41
|
+
frame = microphone.read 1024
|
42
|
+
speaker.write frame
|
43
|
+
end
|
44
|
+
|
data/Rakefile
CHANGED