coreaudio 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -0,0 +1,60 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "coreaudio"
8
+ s.version = "0.0.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["CHIKANAGA Tomoyuki"]
12
+ s.date = "2011-10-10"
13
+ s.description = "Mac OS X CoreAudio wrapper library"
14
+ s.email = "nagachika00@gmail.com"
15
+ s.extensions = ["ext/extconf.rb"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "README.rdoc"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "LICENSE.txt",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "coreaudio.gemspec",
29
+ "examples/outbuffer_sine.rb",
30
+ "examples/outloop_sine.rb",
31
+ "examples/record_to_wave.rb",
32
+ "ext/audiofile.m",
33
+ "ext/coreaudio.h",
34
+ "ext/coreaudio.m",
35
+ "ext/depend",
36
+ "ext/extconf.rb",
37
+ "lib/coreaudio.rb"
38
+ ]
39
+ s.homepage = "http://github.com/nagachika/coreaudio"
40
+ s.licenses = ["BSDL"]
41
+ s.require_paths = ["lib"]
42
+ s.rubygems_version = "1.8.11"
43
+ s.summary = "Mac OS X CoreAudio wrapper library"
44
+
45
+ if s.respond_to? :specification_version then
46
+ s.specification_version = 3
47
+
48
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
49
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
50
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
51
+ else
52
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
53
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
54
+ end
55
+ else
56
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
57
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
58
+ end
59
+ end
60
+
@@ -63,7 +63,7 @@ ca_audio_file_memsize(const void *ptr)
63
63
 
64
64
  static const rb_data_type_t ca_audio_file_type = {
65
65
  "ca_audio_file",
66
- {NULL, ca_audio_file_free, ca_audio_file_memsize},
66
+ {NULL, ca_audio_file_free, ca_audio_file_memsize}
67
67
  };
68
68
 
69
69
  static VALUE
@@ -106,7 +106,6 @@ ca_audio_file_initialize(int argc, VALUE *argv, VALUE self)
106
106
  UInt32 channel, file_channel;
107
107
  CFURLRef outUrl = NULL;
108
108
  AudioFileTypeID filetype;
109
- ExtAudioFileRef audioFileRef = NULL;
110
109
  UInt32 flags = kAudioFileFlags_EraseFile;
111
110
  OSStatus err = noErr;
112
111
 
@@ -226,13 +225,13 @@ ca_audio_file_write(VALUE self, VALUE data)
226
225
 
227
226
  TypedData_Get_Struct(self, ca_audio_file_t, &ca_audio_file_type, file);
228
227
 
229
- frames = RARRAY_LEN(data) / file->inner_desc.mChannelsPerFrame;
228
+ frames = RARRAY_LENINT(data) / file->inner_desc.mChannelsPerFrame;
230
229
  alloc_size = (file->inner_desc.mBitsPerChannel/8) * RARRAY_LEN(data);
231
230
 
232
231
  /* prepare interleaved audio buffer */
233
232
  buf_list.mNumberBuffers = 1;
234
233
  buf_list.mBuffers[0].mNumberChannels = file->inner_desc.mChannelsPerFrame;
235
- buf_list.mBuffers[0].mDataByteSize = alloc_size;
234
+ buf_list.mBuffers[0].mDataByteSize = (UInt32)alloc_size;
236
235
  buf_list.mBuffers[0].mData = xmalloc(alloc_size);
237
236
  buf = buf_list.mBuffers[0].mData;
238
237
 
@@ -422,7 +422,7 @@ ca_out_loop_proc(
422
422
  float *ptr = outOutputData->mBuffers[i].mData;
423
423
  UInt32 size = outOutputData->mBuffers[i].mDataByteSize / (UInt32)sizeof(float) / channel;
424
424
  UInt32 offset = (UInt32)inOutputTime->mSampleTime % loop_data->frame;
425
- UInt32 copied = 0;
425
+ unsigned long copied = 0;
426
426
 
427
427
  if (outOutputData->mBuffers[i].mNumberChannels != channel) {
428
428
  memset(ptr, 0, size * channel * sizeof(float));
@@ -0,0 +1,2 @@
1
+ coreaudio.o: coreaudio.m coreaudio.h
2
+ audiofile.o: audiofile.m coreaudio.h
@@ -1,6 +1,21 @@
1
1
  require 'mkmf'
2
2
 
3
- $CFLAGS = "-ObjC"
3
+ $CFLAGS << " " << "-ObjC"
4
+
5
+ unless defined?(have_framework)
6
+ def have_framework(fw, &b)
7
+ checking_for fw do
8
+ src = cpp_include("#{fw}/#{fw}.h") << "\n" "int main(void){return 0;}"
9
+ if try_link(src, opt = "-ObjC -framework #{fw}", &b)
10
+ $defs.push(format("-DHAVE_FRAMEWORK_%s", fw.tr_cpp))
11
+ $LDFLAGS << " " << opt
12
+ true
13
+ else
14
+ false
15
+ end
16
+ end
17
+ end
18
+ end
4
19
 
5
20
  dir_config("coreaudio")
6
21
  if have_framework("CoreAudio") and
@@ -8,4 +23,13 @@ if have_framework("CoreAudio") and
8
23
  have_framework("CoreFoundation") and
9
24
  have_framework("Cocoa")
10
25
  create_makefile("coreaudio/coreaudio_ext")
26
+ # workaround for mkmf.rb in 1.9.2
27
+ if RUBY_VERSION < "1.9.3"
28
+ open("Makefile", "a") do |f|
29
+ f.puts <<-EOS
30
+ .m.o:
31
+ $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
32
+ EOS
33
+ end
34
+ end
11
35
  end
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.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-07 00:00:00.000000000 Z
12
+ date: 2011-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
- requirement: &2151973540 !ruby/object:Gem::Requirement
16
+ requirement: &2157890960 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.0.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2151973540
24
+ version_requirements: *2157890960
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: jeweler
27
- requirement: &2155991220 !ruby/object:Gem::Requirement
27
+ requirement: &2157890240 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 1.6.4
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2155991220
35
+ version_requirements: *2157890240
36
36
  description: Mac OS X CoreAudio wrapper library
37
37
  email: nagachika00@gmail.com
38
38
  executables: []
@@ -49,12 +49,14 @@ files:
49
49
  - README.rdoc
50
50
  - Rakefile
51
51
  - VERSION
52
+ - coreaudio.gemspec
52
53
  - examples/outbuffer_sine.rb
53
54
  - examples/outloop_sine.rb
54
55
  - examples/record_to_wave.rb
55
56
  - ext/audiofile.m
56
57
  - ext/coreaudio.h
57
58
  - ext/coreaudio.m
59
+ - ext/depend
58
60
  - ext/extconf.rb
59
61
  - lib/coreaudio.rb
60
62
  homepage: http://github.com/nagachika/coreaudio
@@ -72,7 +74,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
72
74
  version: '0'
73
75
  segments:
74
76
  - 0
75
- hash: -2078293831833669987
77
+ hash: 487073156904496213
76
78
  required_rubygems_version: !ruby/object:Gem::Requirement
77
79
  none: false
78
80
  requirements: