hornetseye-alsa 0.4.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -3
- data/lib/hornetseye-alsa/alsainput.rb +3 -3
- data/lib/hornetseye-alsa/alsaoutput.rb +3 -3
- metadata +13 -9
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 = '1.0.0'
|
11
11
|
CFG = RbConfig::CONFIG
|
12
12
|
CXX = ENV[ 'CXX' ] || 'g++'
|
13
13
|
RB_FILES = FileList[ 'lib/**/*.rb' ]
|
@@ -114,7 +114,7 @@ begin
|
|
114
114
|
s.extra_rdoc_files = []
|
115
115
|
s.rdoc_options = %w{--no-private}
|
116
116
|
s.add_dependency %<malloc>, [ '~> 1.2' ]
|
117
|
-
s.add_dependency %<multiarray>, [ '~> 0
|
117
|
+
s.add_dependency %<multiarray>, [ '~> 1.0' ]
|
118
118
|
s.add_development_dependency %q{rake}
|
119
119
|
end
|
120
120
|
GEM_SOURCE = "#{PKG_NAME}-#{PKG_VERSION}.gem"
|
@@ -136,7 +136,7 @@ begin
|
|
136
136
|
s.extra_rdoc_files = []
|
137
137
|
s.rdoc_options = %w{--no-private}
|
138
138
|
s.add_dependency %<malloc>, [ '~> 1.2' ]
|
139
|
-
s.add_dependency %<multiarray>, [ '~> 0
|
139
|
+
s.add_dependency %<multiarray>, [ '~> 1.0' ]
|
140
140
|
end
|
141
141
|
GEM_BINARY = "#{PKG_NAME}-#{PKG_VERSION}-#{$BINSPEC.platform}.gem"
|
142
142
|
desc "Build the gem file #{GEM_SOURCE}"
|
@@ -40,7 +40,7 @@ module Hornetseye
|
|
40
40
|
# @example Open standard microphone device
|
41
41
|
# require 'hornetseye_alsa'
|
42
42
|
# include Hornetseye
|
43
|
-
# microphone = AlsaInput.new 'default
|
43
|
+
# microphone = AlsaInput.new 'default', 44_100, 2
|
44
44
|
#
|
45
45
|
# @param [String] pcm_name Name of the PCM device
|
46
46
|
# @param [Integer] rate Desired sampling rate.
|
@@ -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
|
53
|
+
def new( pcm_name = 'default', rate = 48000, channels = 2, periods = 8,
|
54
54
|
frames = 1024 )
|
55
55
|
orig_new pcm_name, rate, channels, periods, frames
|
56
56
|
end
|
@@ -74,7 +74,7 @@ module Hornetseye
|
|
74
74
|
# @example Read 3 seconds of audio samples
|
75
75
|
# require 'hornetseye_alsa'
|
76
76
|
# include Hornetseye
|
77
|
-
# microphone = AlsaInput.new 'default
|
77
|
+
# microphone = AlsaInput.new 'default', 44_100, 2
|
78
78
|
# data = microphone.read 3 * 44_100
|
79
79
|
#
|
80
80
|
# @param [Integer] samples Number of samples to read.
|
@@ -40,7 +40,7 @@ module Hornetseye
|
|
40
40
|
# @example Open default speakers
|
41
41
|
# require 'hornetseye_alsa'
|
42
42
|
# include Hornetseye
|
43
|
-
# speaker = AlsaOutput.new 'default
|
43
|
+
# speaker = AlsaOutput.new 'default', 44_100, 2
|
44
44
|
#
|
45
45
|
# @param [String] pcm_name Name of the PCM device
|
46
46
|
# @param [Integer] rate Desired sampling rate.
|
@@ -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
|
53
|
+
def new( pcm_name = 'default', rate = 48000, channels = 2, periods = 8,
|
54
54
|
frames = 1024 )
|
55
55
|
orig_new pcm_name, rate, channels, periods, frames
|
56
56
|
end
|
@@ -75,7 +75,7 @@ module Hornetseye
|
|
75
75
|
# @example Play a 400Hz tune for 3 seconds
|
76
76
|
# require 'hornetseye_alsa'
|
77
77
|
# include Hornetseye
|
78
|
-
# speaker = AlsaOutput.new 'default
|
78
|
+
# speaker = AlsaOutput.new 'default', 44_100, 2
|
79
79
|
# L = 44_100 / 400
|
80
80
|
# wave = lazy( 2, L ) { |j,i| Math.sin( i * 2 * Math::PI / L ) * 0x7FFF }.to_sint
|
81
81
|
# ( 3 * 400 ).times { speaker.write wave }
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hornetseye-alsa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
5
6
|
segments:
|
7
|
+
- 1
|
6
8
|
- 0
|
7
|
-
- 4
|
8
9
|
- 0
|
9
|
-
version: 0.
|
10
|
+
version: 1.0.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Jan Wedekind
|
@@ -14,8 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date:
|
18
|
-
default_executable:
|
18
|
+
date: 2012-11-08 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: malloc
|
@@ -25,6 +25,7 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
+
hash: 11
|
28
29
|
segments:
|
29
30
|
- 1
|
30
31
|
- 2
|
@@ -39,10 +40,11 @@ dependencies:
|
|
39
40
|
requirements:
|
40
41
|
- - ~>
|
41
42
|
- !ruby/object:Gem::Version
|
43
|
+
hash: 15
|
42
44
|
segments:
|
45
|
+
- 1
|
43
46
|
- 0
|
44
|
-
|
45
|
-
version: "0.23"
|
47
|
+
version: "1.0"
|
46
48
|
type: :runtime
|
47
49
|
version_requirements: *id002
|
48
50
|
- !ruby/object:Gem::Dependency
|
@@ -53,6 +55,7 @@ dependencies:
|
|
53
55
|
requirements:
|
54
56
|
- - ">="
|
55
57
|
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
56
59
|
segments:
|
57
60
|
- 0
|
58
61
|
version: "0"
|
@@ -84,7 +87,6 @@ files:
|
|
84
87
|
- ext/alsaoutput.hh
|
85
88
|
- ext/error.hh
|
86
89
|
- ext/rubyinc.hh
|
87
|
-
has_rdoc: yard
|
88
90
|
homepage: http://wedesoft.github.com/hornetseye-alsa/
|
89
91
|
licenses: []
|
90
92
|
|
@@ -99,6 +101,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
101
|
requirements:
|
100
102
|
- - ">="
|
101
103
|
- !ruby/object:Gem::Version
|
104
|
+
hash: 3
|
102
105
|
segments:
|
103
106
|
- 0
|
104
107
|
version: "0"
|
@@ -107,13 +110,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
110
|
requirements:
|
108
111
|
- - ">="
|
109
112
|
- !ruby/object:Gem::Version
|
113
|
+
hash: 3
|
110
114
|
segments:
|
111
115
|
- 0
|
112
116
|
version: "0"
|
113
117
|
requirements: []
|
114
118
|
|
115
119
|
rubyforge_project: hornetseye
|
116
|
-
rubygems_version: 1.
|
120
|
+
rubygems_version: 1.8.15
|
117
121
|
signing_key:
|
118
122
|
specification_version: 3
|
119
123
|
summary: Play audio data using libalsa
|