albanpeignier-alsa-backup 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -1
- data/alsa-backup.gemspec +2 -2
- data/config.sample +5 -0
- data/lib/alsa.rb +2 -2
- data/lib/alsa_backup.rb +1 -1
- data/lib/sndfile.rb +3 -3
- metadata +2 -2
data/History.txt
CHANGED
data/alsa-backup.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{alsa-backup}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.6"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Alban Peignier"]
|
9
|
-
s.date = %q{2009-05-
|
9
|
+
s.date = %q{2009-05-28}
|
10
10
|
s.default_executable = %q{alsa.backup}
|
11
11
|
s.description = %q{ALSA client to perform continuous recording}
|
12
12
|
s.email = ["alban.peignier@free.fr"]
|
data/config.sample
CHANGED
data/lib/alsa.rb
CHANGED
@@ -94,8 +94,8 @@ module ALSA
|
|
94
94
|
ALSA.logger.debug { "start read with #{hw_params.sample_rate}, #{hw_params.channels} channels"}
|
95
95
|
|
96
96
|
# use an 500ms buffer
|
97
|
-
frame_count = hw_params.sample_rate / 2
|
98
|
-
|
97
|
+
frame_count = hw_params.sample_rate / 2
|
98
|
+
ALSA.logger.debug { "allocate #{hw_params.buffer_size_for(frame_count)} bytes for #{frame_count} frames" }
|
99
99
|
FFI::MemoryPointer.new(:char, hw_params.buffer_size_for(frame_count)) do |buffer|
|
100
100
|
begin
|
101
101
|
read_buffer buffer, frame_count
|
data/lib/alsa_backup.rb
CHANGED
data/lib/sndfile.rb
CHANGED
@@ -40,8 +40,8 @@ module Sndfile
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def write(buffer, frame_count)
|
43
|
-
ALSA.logger.debug { "write #{frame_count} frames in #{path}"}
|
44
|
-
write_count = Sndfile::Native::
|
43
|
+
ALSA.logger.debug { "write #{frame_count} frames in #{path}" }
|
44
|
+
write_count = Sndfile::Native::write_short(@handle, buffer, frame_count)
|
45
45
|
|
46
46
|
unless write_count == frame_count
|
47
47
|
raise self.error
|
@@ -132,7 +132,7 @@ module Sndfile
|
|
132
132
|
|
133
133
|
# TODO off_t won't work on windows
|
134
134
|
attach_function :write_int, :sf_write_int, [ :pointer, :pointer, :off_t ], :off_t
|
135
|
-
|
135
|
+
attach_function :write_short, :sf_write_short, [ :pointer, :pointer, :off_t ], :off_t
|
136
136
|
|
137
137
|
attach_function :strerror, :sf_strerror, [ :pointer ], :string
|
138
138
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: albanpeignier-alsa-backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alban Peignier
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-05-
|
12
|
+
date: 2009-05-28 00:00:00 -07:00
|
13
13
|
default_executable: alsa.backup
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|