hornetseye-alsa 0.3.5 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +2 -1
- data/Rakefile +4 -5
- data/ext/init.cc +1 -1
- data/lib/hornetseye-alsa/alsainput.rb +3 -4
- data/lib/hornetseye-alsa/alsaoutput.rb +2 -2
- metadata +12 -12
data/README.md
CHANGED
@@ -8,10 +8,11 @@ hornetseye-alsa
|
|
8
8
|
Synopsis
|
9
9
|
--------
|
10
10
|
|
11
|
-
This Ruby extension provides an interface for playing audio data using the Advanced Linux Sound Architecture (ALSA).
|
11
|
+
This Ruby extension provides an interface for playing and recording audio data using the Advanced Linux Sound Architecture (ALSA).
|
12
12
|
|
13
13
|
Installation
|
14
14
|
------------
|
15
|
+
|
15
16
|
*hornetseye-alsa* requires the ALSA library. If you are running Debian or (K)ubuntu, you can install it like this:
|
16
17
|
|
17
18
|
$ sudo aptitude install libasound2-dev
|
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ require 'rake/loaders/makefile'
|
|
7
7
|
require 'rbconfig'
|
8
8
|
|
9
9
|
PKG_NAME = 'hornetseye-alsa'
|
10
|
-
PKG_VERSION = '0.
|
10
|
+
PKG_VERSION = '0.4.0'
|
11
11
|
CFG = RbConfig::CONFIG
|
12
12
|
CXX = ENV[ 'CXX' ] || 'g++'
|
13
13
|
RB_FILES = FileList[ 'lib/**/*.rb' ]
|
@@ -81,8 +81,7 @@ end
|
|
81
81
|
begin
|
82
82
|
require 'yard'
|
83
83
|
YARD::Rake::YardocTask.new :yard do |y|
|
84
|
-
y.
|
85
|
-
y.files << FileList[ 'lib/**/*.rb' ]
|
84
|
+
y.files << RB_FILES
|
86
85
|
end
|
87
86
|
rescue LoadError
|
88
87
|
STDERR.puts 'Please install \'yard\' if you want to generate documentation'
|
@@ -115,7 +114,7 @@ begin
|
|
115
114
|
s.extra_rdoc_files = []
|
116
115
|
s.rdoc_options = %w{--no-private}
|
117
116
|
s.add_dependency %<malloc>, [ '~> 1.2' ]
|
118
|
-
s.add_dependency %<multiarray>, [ '~> 0.
|
117
|
+
s.add_dependency %<multiarray>, [ '~> 0.23' ]
|
119
118
|
s.add_development_dependency %q{rake}
|
120
119
|
end
|
121
120
|
GEM_SOURCE = "#{PKG_NAME}-#{PKG_VERSION}.gem"
|
@@ -137,7 +136,7 @@ begin
|
|
137
136
|
s.extra_rdoc_files = []
|
138
137
|
s.rdoc_options = %w{--no-private}
|
139
138
|
s.add_dependency %<malloc>, [ '~> 1.2' ]
|
140
|
-
s.add_dependency %<multiarray>, [ '~> 0.
|
139
|
+
s.add_dependency %<multiarray>, [ '~> 0.23' ]
|
141
140
|
end
|
142
141
|
GEM_BINARY = "#{PKG_NAME}-#{PKG_VERSION}-#{$BINSPEC.platform}.gem"
|
143
142
|
desc "Build the gem file #{GEM_SOURCE}"
|
data/ext/init.cc
CHANGED
@@ -30,7 +30,7 @@ extern "C" {
|
|
30
30
|
|
31
31
|
void Init_hornetseye_alsa(void)
|
32
32
|
{
|
33
|
-
|
33
|
+
rb_eval_string( "require 'multiarray'" );
|
34
34
|
VALUE rbHornetseye = rb_define_module( "Hornetseye" );
|
35
35
|
AlsaOutput::registerRubyClass( rbHornetseye );
|
36
36
|
AlsaInput::registerRubyClass( rbHornetseye );
|
@@ -50,7 +50,7 @@ module Hornetseye
|
|
50
50
|
# @return [AlsaInput] An object for accessing the microphone.
|
51
51
|
#
|
52
52
|
# @see #rate
|
53
|
-
def new( pcm_name = 'default:0', rate = 48000, channels = 2, periods =
|
53
|
+
def new( pcm_name = 'default:0', rate = 48000, channels = 2, periods = 8,
|
54
54
|
frames = 1024 )
|
55
55
|
orig_new pcm_name, rate, channels, periods, frames
|
56
56
|
end
|
@@ -79,9 +79,8 @@ module Hornetseye
|
|
79
79
|
#
|
80
80
|
# @param [Integer] samples Number of samples to read.
|
81
81
|
# @return [Node] A two-dimensional array with short-integer audio samples.
|
82
|
-
def read(
|
83
|
-
|
84
|
-
new orig_read( samples ).memory
|
82
|
+
def read(samples)
|
83
|
+
MultiArray.import SINT, orig_read(samples).memory, channels, samples
|
85
84
|
end
|
86
85
|
|
87
86
|
end
|
@@ -50,7 +50,7 @@ module Hornetseye
|
|
50
50
|
# @return [AlsaOutput] An object for accessing the speakers.
|
51
51
|
#
|
52
52
|
# @see #rate
|
53
|
-
def new( pcm_name = 'default:0', rate = 48000, channels = 2, periods =
|
53
|
+
def new( pcm_name = 'default:0', rate = 48000, channels = 2, periods = 8,
|
54
54
|
frames = 1024 )
|
55
55
|
orig_new pcm_name, rate, channels, periods, frames
|
56
56
|
end
|
@@ -94,7 +94,7 @@ module Hornetseye
|
|
94
94
|
raise "Audio frame must have #{channels} channel(s) but had " +
|
95
95
|
"#{frame.shape.first}"
|
96
96
|
end
|
97
|
-
orig_write Hornetseye::Sequence(
|
97
|
+
orig_write Hornetseye::Sequence(UBYTE).new 2 * frame.size, :memory => frame.memory
|
98
98
|
frame
|
99
99
|
end
|
100
100
|
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 4
|
8
|
+
- 0
|
9
|
+
version: 0.4.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jan Wedekind
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-06-29 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -41,8 +41,8 @@ dependencies:
|
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
segments:
|
43
43
|
- 0
|
44
|
-
-
|
45
|
-
version: "0.
|
44
|
+
- 23
|
45
|
+
version: "0.23"
|
46
46
|
type: :runtime
|
47
47
|
version_requirements: *id002
|
48
48
|
- !ruby/object:Gem::Dependency
|
@@ -71,19 +71,19 @@ files:
|
|
71
71
|
- README.md
|
72
72
|
- COPYING
|
73
73
|
- .document
|
74
|
+
- lib/hornetseye_alsa_ext.rb
|
74
75
|
- lib/hornetseye-alsa/alsainput.rb
|
75
|
-
- lib/hornetseye-alsa/docs.rb
|
76
76
|
- lib/hornetseye-alsa/alsaoutput.rb
|
77
|
-
- lib/
|
78
|
-
- ext/alsainput.cc
|
79
|
-
- ext/init.cc
|
77
|
+
- lib/hornetseye-alsa/docs.rb
|
80
78
|
- ext/sequence.cc
|
79
|
+
- ext/init.cc
|
80
|
+
- ext/alsainput.cc
|
81
81
|
- ext/alsaoutput.cc
|
82
82
|
- ext/sequence.hh
|
83
83
|
- ext/alsainput.hh
|
84
|
-
- ext/rubyinc.hh
|
85
|
-
- ext/error.hh
|
86
84
|
- ext/alsaoutput.hh
|
85
|
+
- ext/error.hh
|
86
|
+
- ext/rubyinc.hh
|
87
87
|
has_rdoc: yard
|
88
88
|
homepage: http://wedesoft.github.com/hornetseye-alsa/
|
89
89
|
licenses: []
|