ao 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e18bc1b8338dbf4e313191d954a87e69b8aa219794b0f4f6cf1251fef997c60
4
- data.tar.gz: 95e10d543538aad48d4cc00969db2c0e306514a38ce7f520bc05defe146d93fa
3
+ metadata.gz: 95b55efc78c4e08cecf01300b2498ae7d0167133de4c7b45eda9833096075574
4
+ data.tar.gz: c0642596b538bd9369747e314c338d1bca68154edf8d8799cadf346093968047
5
5
  SHA512:
6
- metadata.gz: d18f0c1c2b5d77c98137fd65e0ceb3c7f81b69af45ff6a2f2914a91d6ca41d8020cd5a582c83df2802ef1c4a84aaa8e221cc9151f90ba19792467312c4d060b6
7
- data.tar.gz: 11f116e38ace4bfba36fb7dcc573481a0f2e866a08f224e962036fb5bfe9bcca4bd06772053f349f449734a79a0998adf89b489800925ad79618d2651c497ba3
6
+ metadata.gz: 56453a03af111246aad7b0af58fd572f796021ffc006a65cb27cc91b3bb4c2509fd407153b236ac4028ef89ffe597bada7c0f33cae83f016ebb345eb777b8fbd
7
+ data.tar.gz: 6d2ef0d6a259de0fad48975ec617a14d0a1fc10e3303d86eb2ab57beebe6d2fb3a98edc02b1b6b93d3f91fdbdce3489e51000c1157e8463bbe352987f5108eb6
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = Ruby-AO(libao Ruby Interface)
2
2
 
3
- * http://bitbucket.org/phenomer/ruby-ao
3
+ * https://github.com/phenomer/ruby-ao
4
4
 
5
5
  == 概要
6
6
  ruby-aoは、シンプルでクロスプラットフォームなオーディオ出力ライブラリ
data/example/rawplay.rb CHANGED
@@ -12,7 +12,7 @@ require 'audio/output'
12
12
 
13
13
  ARGV.each{|file|
14
14
  if File.file?(file)
15
- Audio::LiveOutput.new(bits: 16, rate: 44100, channels: 2,
15
+ Audio::LiveOutput.new(driver_id: Audio::Info.default_driver_id, bits: 16, rate: 44100, channels: 2,
16
16
  byte_format: Audio::Info::FMT_LITTLE){|ao|
17
17
  File.open(file){|f|
18
18
  while buffer = f.read(4096)
data/ext/audio/device.c CHANGED
@@ -97,7 +97,6 @@ raodev_play(VALUE obj, VALUE output_samples)
97
97
  */
98
98
  void
99
99
  close_device(ao_struct *aos){
100
- int i;
101
100
  sample_t *sample;
102
101
 
103
102
  if (aos->tmode == 1){
@@ -113,21 +112,21 @@ close_device(ao_struct *aos){
113
112
  free(sample);
114
113
  }
115
114
  pthread_join(aos->thread, NULL);
116
- } else {
117
- if (aos->device != NULL){
118
- ao_close(aos->device);
119
- }
120
- if (aos->option != NULL){
121
- ao_free_options(aos->option);
122
- }
123
- if (aos->format != NULL){
124
- free_format(aos->format);
125
- }
126
- aos->device = NULL;
127
- aos->option = NULL;
128
- aos->format = NULL;
129
- aos->queue = NULL;
130
115
  }
116
+
117
+ if (aos->device != NULL){
118
+ ao_close(aos->device);
119
+ }
120
+ if (aos->option != NULL){
121
+ ao_free_options(aos->option);
122
+ }
123
+ if (aos->format != NULL){
124
+ free_format(aos->format);
125
+ }
126
+ aos->device = NULL;
127
+ aos->option = NULL;
128
+ aos->format = NULL;
129
+ aos->queue = NULL;
131
130
  return;
132
131
  }
133
132
 
@@ -1,8 +1,5 @@
1
1
  #include "cao.h"
2
2
 
3
- VALUE cAudio;
4
- VALUE cAO_Live;
5
- VALUE cAO_File;
6
3
  VALUE cAO_eAOError;
7
4
  VALUE cAO_eNoDriver;
8
5
  VALUE cAO_eNotFile;
data/ext/audio/info.c CHANGED
@@ -4,12 +4,6 @@
4
4
  #include <errno.h>
5
5
  #include "cao.h"
6
6
 
7
- VALUE cAudio;
8
- VALUE cAO_Live;
9
- VALUE cAO_Info;
10
- VALUE cAO_eDriverError;
11
- VALUE cAO_eBadFormat;
12
-
13
7
  /*
14
8
  ao_info構造体をRubyのHashに変換し返す。
15
9
  */
data/ext/audio/mixer.c CHANGED
@@ -9,7 +9,7 @@ int
9
9
  mix_sample_8(sample_t **samples, sample_t *ret, int chs){
10
10
  int32_t sum;
11
11
  int ch;
12
- int pos;
12
+ uint32_t pos;
13
13
  int8_t *buffer;
14
14
  int8_t *src;
15
15
 
@@ -31,7 +31,7 @@ int
31
31
  mix_sample_16(sample_t **samples, sample_t *ret, int chs){
32
32
  int32_t sum;
33
33
  int ch;
34
- int pos;
34
+ uint32_t pos;
35
35
  int16_t *buffer;
36
36
  int16_t *src;
37
37
 
@@ -80,7 +80,7 @@ rao_mix_samples(VALUE obj, VALUE bits, VALUE rsamples){
80
80
  sample_t ret;
81
81
  int stat;
82
82
  int chs = 0;
83
- int maxlen = 0;
83
+ uint32_t maxlen = 0;
84
84
 
85
85
  Check_Type(bits, T_FIXNUM);
86
86
  Check_Type(rsamples, T_ARRAY);
data/ext/audio/option.c CHANGED
@@ -4,10 +4,6 @@
4
4
  #include <errno.h>
5
5
  #include "cao.h"
6
6
 
7
- VALUE cAudio;
8
- VALUE cAO_Info;
9
- VALUE cAO_eUnknownError;
10
-
11
7
  /*
12
8
  引数に設定されたサンプルフォーマットをao_sample_format構造体に設定する。
13
9
  成功したらao_sample_format構造体へのポインタを返す。
@@ -17,7 +13,6 @@ set_format(VALUE bits, VALUE rate, VALUE channels,
17
13
  VALUE byte_format, VALUE matrix)
18
14
  {
19
15
  ao_sample_format *format;
20
- size_t len;
21
16
 
22
17
  if ((format = malloc(sizeof(ao_sample_format))) == NULL){
23
18
  rb_raise(cAO_eUnknownError, "memory allocation failure.");
data/ext/audio/output.c CHANGED
@@ -4,21 +4,10 @@
4
4
  #include <errno.h>
5
5
  #include "cao.h"
6
6
 
7
- VALUE cAudio;
8
7
  VALUE cAO_Live;
9
8
  VALUE cAO_File;
10
- VALUE cAO_Info;
11
9
  VALUE cAO_Mixer;
12
10
  VALUE cAO_DeviceData;
13
- VALUE cAO_eAOError;
14
- VALUE cAO_eDeviceError;
15
- VALUE cAO_eUnknownError;
16
-
17
- VALUE cAO_eNoDriver;
18
- VALUE cAO_eNotFile;
19
- VALUE cAO_eNotLive;
20
- VALUE cAO_eBadOption;
21
- VALUE cAO_eDriverError;
22
11
 
23
12
  VALUE
24
13
  rao_close(VALUE obj)
@@ -82,7 +71,7 @@ Init_outputc(void)
82
71
  * 開いたデバイスに関する基本的な情報を保持するクラス。
83
72
  * ruby側から操作はしない。
84
73
  */
85
- cAO_DeviceData = rb_define_class_under(cAO_Live, "DeviceData", rb_cData);
74
+ cAO_DeviceData = rb_define_class_under(cAO_Live, "DeviceData", rb_cObject);
86
75
 
87
76
  /* library initialize & shutdown */
88
77
  rb_define_private_method(cAO_Live, "initialize", rao_open_live, 8);
data/ext/audio/thread.c CHANGED
@@ -12,7 +12,6 @@
12
12
 
13
13
  void *
14
14
  thread_player(void *val){
15
- queue res;
16
15
  ao_struct *aos = val;
17
16
  sample_t *sample;
18
17
  struct timespec tout = {0, 1000000};
@@ -52,23 +51,6 @@ thread_player(void *val){
52
51
  assert(pthread_mutex_unlock(&aos->mutex) == 0);
53
52
  }
54
53
 
55
- while ((sample = dequeue(aos)) != NULL){
56
- free(sample->buffer);
57
- free(sample);
58
- }
59
- if (aos->device != NULL){
60
- ao_close(aos->device);
61
- }
62
- if (aos->option != NULL){
63
- ao_free_options(aos->option);
64
- }
65
- if (aos->format != NULL){
66
- free_format(aos->format);
67
- }
68
- aos->device = NULL;
69
- aos->option = NULL;
70
- aos->format = NULL;
71
- aos->queue = NULL;
72
54
  assert(pthread_mutex_lock(&aos->mutex) == 0);
73
55
  aos->status = -1;
74
56
  assert(pthread_mutex_unlock(&aos->mutex) == 0);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ao
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akito Miura
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-18 00:00:00.000000000 Z
11
+ date: 2022-06-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: simple & cross platform audio output library(libao binding http://http://xiph.org/ao/)
14
14
  email: phenomer@g.hachune.net
@@ -59,7 +59,7 @@ homepage: http://bitbucket.org/phenomer/ruby-ao
59
59
  licenses:
60
60
  - MIT
61
61
  metadata: {}
62
- post_install_message:
62
+ post_install_message:
63
63
  rdoc_options:
64
64
  - "-m README.rdoc"
65
65
  require_paths:
@@ -68,16 +68,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - ">="
70
70
  - !ruby/object:Gem::Version
71
- version: 2.4.0
71
+ version: 2.7.0
72
72
  required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - ">="
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
- rubyforge_project:
79
- rubygems_version: 2.7.3
80
- signing_key:
78
+ rubygems_version: 3.3.3
79
+ signing_key:
81
80
  specification_version: 4
82
81
  summary: simple & cross platform audio output library
83
82
  test_files: []