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 CHANGED
@@ -1,6 +1,10 @@
1
+ == 0.0.6
2
+
3
+ * Fix file writing problem
4
+
1
5
  == 0.0.5
2
6
 
3
- * Fixe half buffer writing in recording file
7
+ * Fix half buffer writing in recording file
4
8
 
5
9
  == 0.0.4
6
10
 
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"
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-27}
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
@@ -13,6 +13,11 @@
13
13
  # logger.level = Logger::INFO
14
14
  #end
15
15
 
16
+ #
17
+ # To debug
18
+ #
19
+ #Sndfile::logger = ALSA::logger = AlsaBackup.logger = Logger.new(STDOUT)
20
+
16
21
  AlsaBackup.logger.info("load config #{__FILE__}")
17
22
 
18
23
  AlsaBackup.config do |recorder|
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 * hw_params.channels
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
@@ -10,7 +10,7 @@ require 'activesupport'
10
10
  require 'logger'
11
11
 
12
12
  module AlsaBackup
13
- VERSION = '0.0.5'
13
+ VERSION = '0.0.6'
14
14
 
15
15
  def self.recorder
16
16
  @recorder ||= AlsaBackup::Recorder.new
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::write_int(@handle, buffer, frame_count)
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.5
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-27 00:00:00 -07:00
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