coreaudio 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog ADDED
@@ -0,0 +1,54 @@
1
+ Fri Feb 24 00:47:07 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
2
+
3
+ * ext/coreaudio.m (ca_out_buffer_data_append): fix last 1 frame
4
+ is overwritten by next buffer's first frame. fixes issue #7.
5
+ reported by dturnbull. Thank you!
6
+
7
+ Fri Feb 23 23:24:00 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
8
+
9
+ * Gemfile: use 'gemspec'
10
+ * Gemfile.lock: delete from reository
11
+ * .gitignore: add Gemfile.lock for ignore list
12
+ * coreaudio.gemspec: udpate dependent version of jeweler
13
+
14
+ Fri Nov 25 01:03:49 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
15
+
16
+ * examples/fft_shift_pitch.rb: ignore first element of fft result.
17
+
18
+ Tue Nov 22 00:09:30 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
19
+
20
+ * ext/audiofile.m(ca_audio_file_initialize): convert first argument
21
+ to String if necessary.
22
+
23
+ Sat Nov 12 18:23:10 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
24
+
25
+ * release 0.0.6
26
+ * change usage of rb_scan_args() in AudioFile.new. support ruby 1.9.2.
27
+
28
+ Tue Nov 1 22:01:39 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
29
+
30
+ * release 0.0.5
31
+ * fix an error in get name of audio device on some environment.
32
+ (use CFStringGetCString() instead of CFStringGetCStringPtr())
33
+
34
+ Sat Oct 29 00:55:11 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
35
+
36
+ * release 0.0.4
37
+ * use NArray for audio data.
38
+ * rename AudioFile.new option keyword(:channel -> :channels)
39
+ * add some examples.
40
+
41
+ Mon Oct 17 01:19:36 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
42
+
43
+ * release 0.0.2
44
+ * add CoreAudio::AudioFile, ability to read/write audio file.
45
+
46
+ Mon Oct 10 23:01:23 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
47
+
48
+ * release 0.0.2
49
+ * fix build error with 1.9.2
50
+
51
+ Sat Oct 8 02:52:38 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
52
+
53
+ * release 0.0.1
54
+ * initial release
data/Gemfile CHANGED
@@ -1,14 +1,3 @@
1
1
  source "http://rubygems.org"
2
- # Add dependencies required to use your gem here.
3
- # Example:
4
- # gem "activesupport", ">= 2.3.5"
5
- gem "narray", "~> 0.6.0.0"
6
2
 
7
- # Add dependencies to develop your gem here.
8
- # Include everything needed to run rake, tests, features, etc.
9
- group :development do
10
- gem "bundler", "~> 1.0.0"
11
- gem "jeweler", "~> 1.6.4"
12
- gem "rake", "~> 0.9.2"
13
- gem "rdoc"
14
- end
3
+ gemspec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.7
data/coreaudio.gemspec CHANGED
@@ -5,22 +5,23 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "coreaudio"
8
- s.version = "0.0.6"
8
+ s.version = "0.0.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["CHIKANAGA Tomoyuki"]
12
- s.date = "2011-11-12"
12
+ s.date = "2012-02-23"
13
13
  s.description = "Mac OS X CoreAudio wrapper library"
14
14
  s.email = "nagachika00@gmail.com"
15
15
  s.extensions = ["ext/extconf.rb"]
16
16
  s.extra_rdoc_files = [
17
+ "ChangeLog",
17
18
  "LICENSE.txt",
18
19
  "README.rdoc"
19
20
  ]
20
21
  s.files = [
21
22
  ".document",
23
+ "ChangeLog",
22
24
  "Gemfile",
23
- "Gemfile.lock",
24
25
  "LICENSE.txt",
25
26
  "README.rdoc",
26
27
  "Rakefile",
@@ -52,22 +53,22 @@ Gem::Specification.new do |s|
52
53
  s.specification_version = 3
53
54
 
54
55
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
55
- s.add_runtime_dependency(%q<narray>, ["~> 0.6.0.0"])
56
+ s.add_runtime_dependency(%q<coreaudio>, [">= 0"])
56
57
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
57
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
58
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.0"])
58
59
  s.add_development_dependency(%q<rake>, ["~> 0.9.2"])
59
60
  s.add_development_dependency(%q<rdoc>, [">= 0"])
60
61
  else
61
- s.add_dependency(%q<narray>, ["~> 0.6.0.0"])
62
+ s.add_dependency(%q<coreaudio>, [">= 0"])
62
63
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
63
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
64
+ s.add_dependency(%q<jeweler>, ["~> 1.8.0"])
64
65
  s.add_dependency(%q<rake>, ["~> 0.9.2"])
65
66
  s.add_dependency(%q<rdoc>, [">= 0"])
66
67
  end
67
68
  else
68
- s.add_dependency(%q<narray>, ["~> 0.6.0.0"])
69
+ s.add_dependency(%q<coreaudio>, [">= 0"])
69
70
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
70
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
71
+ s.add_dependency(%q<jeweler>, ["~> 1.8.0"])
71
72
  s.add_dependency(%q<rake>, ["~> 0.9.2"])
72
73
  s.add_dependency(%q<rdoc>, [">= 0"])
73
74
  end
@@ -15,9 +15,9 @@ pitch_shift_th = Thread.start do
15
15
  f = FFTW3.fft(w, 1)
16
16
  shift = 12
17
17
  f.shape[0].times do |ch|
18
- f[ch, shift...half] = f[ch, 0...(half-shift)]
19
- f[ch, 0...shift] = 0
20
- f[ch, half...(w.shape[1]-shift)] = f[ch, (half+shift)..-1]
18
+ f[ch, (shift+1)...half] = f[ch, 1...(half-shift)]
19
+ f[ch, 1..shift] = 0
20
+ f[ch, (half+1)...(w.shape[1]-shift)] = f[ch, (half+shift+1)..-1]
21
21
  f[ch, -shift..-1] = 0
22
22
  end
23
23
  outbuf << FFTW3.ifft(f, 1) / w.shape[1]
data/ext/audiofile.m CHANGED
@@ -148,6 +148,8 @@ ca_audio_file_initialize(int argc, VALUE *argv, VALUE self)
148
148
 
149
149
  rb_scan_args(argc, argv, "12", &path, &mode, &opt);
150
150
 
151
+ StringValue(path);
152
+
151
153
  /* check mode */
152
154
  if (NIL_P(mode) || mode == sym_read)
153
155
  data->for_write = FALSE;
data/ext/coreaudio.m CHANGED
@@ -853,13 +853,12 @@ ca_out_buffer_data_append(VALUE self, VALUE nary)
853
853
  "coreaudio: audio buffer NArray rank must be 1 or 2");
854
854
  }
855
855
  buf = NA_PTR_TYPE(nary, short *);
856
-
857
856
  pthread_mutex_lock(&data->mutex);
858
- idx = data->end;
857
+ idx = (data->end + 1) % data->frame;
859
858
  for ( i = 0; i < frames; i++, idx = (idx+1)%data->frame) {
860
- while ( (idx+1) % data->frame == data->start ) {
859
+ while ( idx == data->start ) {
861
860
  int ret, state;
862
- data->end = idx;
861
+ data->end = (idx == 0) ? data->frame-1 : idx - 1;
863
862
  ret = (int)rb_protect(ca_buffer_wait_blocking, (VALUE)data, &state);
864
863
  if (state) {
865
864
  pthread_mutex_unlock(&data->mutex);
data/ext/extconf.rb CHANGED
@@ -45,7 +45,7 @@ or
45
45
  end
46
46
 
47
47
  if have_framework("CoreAudio") and
48
- have_framework("AudioToolBox") and
48
+ have_framework("AudioToolbox") and
49
49
  have_framework("CoreFoundation") and
50
50
  have_framework("Cocoa")
51
51
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coreaudio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-12 00:00:00.000000000 Z
12
+ date: 2012-02-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: narray
16
- requirement: &2152196920 !ruby/object:Gem::Requirement
15
+ name: coreaudio
16
+ requirement: &2157155240 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.6.0.0
21
+ version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152196920
24
+ version_requirements: *2157155240
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &2152211080 !ruby/object:Gem::Requirement
27
+ requirement: &2157153500 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,21 +32,21 @@ dependencies:
32
32
  version: 1.0.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2152211080
35
+ version_requirements: *2157153500
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: jeweler
38
- requirement: &2152207840 !ruby/object:Gem::Requirement
38
+ requirement: &2157152940 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
42
42
  - !ruby/object:Gem::Version
43
- version: 1.6.4
43
+ version: 1.8.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2152207840
46
+ version_requirements: *2157152940
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &2152215760 !ruby/object:Gem::Requirement
49
+ requirement: &2157152300 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.9.2
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2152215760
57
+ version_requirements: *2157152300
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rdoc
60
- requirement: &2152223260 !ruby/object:Gem::Requirement
60
+ requirement: &2157151600 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,19 +65,20 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2152223260
68
+ version_requirements: *2157151600
69
69
  description: Mac OS X CoreAudio wrapper library
70
70
  email: nagachika00@gmail.com
71
71
  executables: []
72
72
  extensions:
73
73
  - ext/extconf.rb
74
74
  extra_rdoc_files:
75
+ - ChangeLog
75
76
  - LICENSE.txt
76
77
  - README.rdoc
77
78
  files:
78
79
  - .document
80
+ - ChangeLog
79
81
  - Gemfile
80
- - Gemfile.lock
81
82
  - LICENSE.txt
82
83
  - README.rdoc
83
84
  - Rakefile
@@ -113,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
114
  version: '0'
114
115
  segments:
115
116
  - 0
116
- hash: 1010818411170530347
117
+ hash: -3474685937770410682
117
118
  required_rubygems_version: !ruby/object:Gem::Requirement
118
119
  none: false
119
120
  requirements:
data/Gemfile.lock DELETED
@@ -1,21 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- git (1.2.5)
5
- jeweler (1.6.4)
6
- bundler (~> 1.0)
7
- git (>= 1.2.5)
8
- rake
9
- narray (0.6.0.1)
10
- rake (0.9.2)
11
- rdoc (3.9.2)
12
-
13
- PLATFORMS
14
- ruby
15
-
16
- DEPENDENCIES
17
- bundler (~> 1.0.0)
18
- jeweler (~> 1.6.4)
19
- narray (~> 0.6.0.0)
20
- rake (~> 0.9.2)
21
- rdoc