icanhasaudio 0.1.1 → 0.1.2
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.
- data/History.txt +6 -0
- data/Manifest.txt +24 -14
- data/README.txt +2 -0
- data/Rakefile +15 -8
- data/ext/icanhasaudio/audio_mpeg_decoder.c +220 -0
- data/ext/icanhasaudio/audio_mpeg_decoder.h +8 -0
- data/ext/icanhasaudio/audio_mpeg_decoder_mp3data.c +96 -0
- data/ext/icanhasaudio/audio_mpeg_decoder_mp3data.h +8 -0
- data/ext/{mpeg_encoder.c → icanhasaudio/audio_mpeg_encoder.c} +94 -102
- data/ext/icanhasaudio/audio_mpeg_encoder.h +8 -0
- data/ext/{rb_ogg.c → icanhasaudio/audio_ogg_decoder.c} +18 -9
- data/ext/icanhasaudio/audio_ogg_decoder.h +8 -0
- data/ext/{extconf.rb → icanhasaudio/extconf.rb} +2 -2
- data/ext/{get_audio.c → icanhasaudio/get_audio.c} +1 -6
- data/ext/{get_audio.h → icanhasaudio/get_audio.h} +2 -0
- data/ext/icanhasaudio/native.c +9 -0
- data/ext/icanhasaudio/native.h +21 -0
- data/ext/{rb_wav.c → icanhasaudio/rb_wav.c} +1 -2
- data/ext/{rb_wav.h → icanhasaudio/rb_wav.h} +1 -2
- data/lib/icanhasaudio.rb +4 -0
- data/lib/icanhasaudio/mpeg.rb +1 -24
- data/lib/icanhasaudio/mpeg/decoder.rb +95 -0
- data/lib/icanhasaudio/ogg.rb +1 -21
- data/lib/icanhasaudio/ogg/decoder.rb +31 -0
- data/lib/icanhasaudio/version.rb +8 -0
- data/lib/icanhasaudio/wav.rb +1 -0
- data/lib/icanhasaudio/wav/file.rb +62 -0
- data/test/assets/icha.mp3 +0 -0
- data/test/helper.rb +15 -0
- data/test/mpeg/test_decoder.rb +20 -0
- data/test/test_mpeg_encoder.rb +2 -4
- metadata +31 -18
- data/ext/decoder.c +0 -95
- data/ext/decoder.h +0 -3
- data/ext/icanhasaudio.c +0 -183
- data/ext/icanhasaudio.h +0 -8
- data/ext/mpeg_encoder.h +0 -10
- data/ext/syncword.c +0 -45
- data/ext/syncword.h +0 -3
@@ -1,9 +1,7 @@
|
|
1
|
-
#include
|
2
|
-
#include <rubyio.h>
|
1
|
+
#include <native.h>
|
3
2
|
|
4
|
-
static
|
5
|
-
|
6
|
-
static void encoder_free(lame_global_flags * gfp) {
|
3
|
+
static void encoder_free(lame_global_flags * gfp)
|
4
|
+
{
|
7
5
|
lame_close(gfp);
|
8
6
|
}
|
9
7
|
|
@@ -13,8 +11,8 @@ static void encoder_free(lame_global_flags * gfp) {
|
|
13
11
|
*
|
14
12
|
* Returns a new MPEG Encoder object.
|
15
13
|
*/
|
16
|
-
static VALUE
|
17
|
-
|
14
|
+
static VALUE encoder_allocate(VALUE klass)
|
15
|
+
{
|
18
16
|
lame_global_flags * gfp = lame_init();
|
19
17
|
id3tag_init(gfp);
|
20
18
|
|
@@ -30,7 +28,8 @@ encoder_allocate(VALUE klass) {
|
|
30
28
|
* Strictly enforce the vbr min bitrate. Normally it will be violated for
|
31
29
|
* analog silence.
|
32
30
|
*/
|
33
|
-
static VALUE
|
31
|
+
static VALUE set_vbr_hard_min(VALUE self, VALUE boolean)
|
32
|
+
{
|
34
33
|
lame_global_flags * gfp;
|
35
34
|
|
36
35
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -44,7 +43,8 @@ static VALUE MpegEncoder_set_vbr_hard_min(VALUE self, VALUE boolean) {
|
|
44
43
|
*
|
45
44
|
* Get the hard minimum flag.
|
46
45
|
*/
|
47
|
-
static VALUE
|
46
|
+
static VALUE get_vbr_hard_min(VALUE self)
|
47
|
+
{
|
48
48
|
lame_global_flags * gfp;
|
49
49
|
|
50
50
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -57,7 +57,8 @@ static VALUE MpegEncoder_get_vbr_hard_min(VALUE self) {
|
|
57
57
|
*
|
58
58
|
* Set the maximum vbr bitrate.
|
59
59
|
*/
|
60
|
-
static VALUE
|
60
|
+
static VALUE set_vbr_max_bitrate(VALUE self, VALUE brate)
|
61
|
+
{
|
61
62
|
lame_global_flags * gfp;
|
62
63
|
|
63
64
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -71,7 +72,7 @@ static VALUE MpegEncoder_set_vbr_max_bitrate(VALUE self, VALUE brate) {
|
|
71
72
|
*
|
72
73
|
* Get the maximum vbr bitrate.
|
73
74
|
*/
|
74
|
-
static VALUE
|
75
|
+
static VALUE get_vbr_max_bitrate(VALUE self) {
|
75
76
|
lame_global_flags * gfp;
|
76
77
|
|
77
78
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -84,7 +85,7 @@ static VALUE MpegEncoder_get_vbr_max_bitrate(VALUE self) {
|
|
84
85
|
*
|
85
86
|
* Set the minimum vbr bitrate.
|
86
87
|
*/
|
87
|
-
static VALUE
|
88
|
+
static VALUE set_vbr_min_bitrate(VALUE self, VALUE brate) {
|
88
89
|
lame_global_flags * gfp;
|
89
90
|
|
90
91
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -98,7 +99,7 @@ static VALUE MpegEncoder_set_vbr_min_bitrate(VALUE self, VALUE brate) {
|
|
98
99
|
*
|
99
100
|
* Get the minimum vbr bitrate.
|
100
101
|
*/
|
101
|
-
static VALUE
|
102
|
+
static VALUE get_vbr_min_bitrate(VALUE self) {
|
102
103
|
lame_global_flags * gfp;
|
103
104
|
|
104
105
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -111,7 +112,7 @@ static VALUE MpegEncoder_get_vbr_min_bitrate(VALUE self) {
|
|
111
112
|
*
|
112
113
|
* Set the bitrate.
|
113
114
|
*/
|
114
|
-
static VALUE
|
115
|
+
static VALUE set_bitrate(VALUE self, VALUE brate) {
|
115
116
|
lame_global_flags * gfp;
|
116
117
|
|
117
118
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -126,7 +127,7 @@ static VALUE MpegEncoder_set_bitrate(VALUE self, VALUE brate) {
|
|
126
127
|
*
|
127
128
|
* Get the bitrate.
|
128
129
|
*/
|
129
|
-
static VALUE
|
130
|
+
static VALUE get_bitrate(VALUE self) {
|
130
131
|
lame_global_flags * gfp;
|
131
132
|
|
132
133
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -139,7 +140,7 @@ static VALUE MpegEncoder_get_bitrate(VALUE self) {
|
|
139
140
|
*
|
140
141
|
* Set the VBR quality. 0 = highest, 9 = lowest
|
141
142
|
*/
|
142
|
-
static VALUE
|
143
|
+
static VALUE set_vbr_quality(VALUE self, VALUE quality) {
|
143
144
|
lame_global_flags * gfp;
|
144
145
|
|
145
146
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -153,7 +154,7 @@ static VALUE MpegEncoder_set_vbr_quality(VALUE self, VALUE quality) {
|
|
153
154
|
*
|
154
155
|
* Get the VBR quality. 0 = highest, 9 = lowest
|
155
156
|
*/
|
156
|
-
static VALUE
|
157
|
+
static VALUE get_vbr_quality(VALUE self) {
|
157
158
|
lame_global_flags * gfp;
|
158
159
|
|
159
160
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -166,7 +167,7 @@ static VALUE MpegEncoder_get_vbr_quality(VALUE self) {
|
|
166
167
|
*
|
167
168
|
* Set the type of VBR. Must be VBR_OFF, VBR_NORMAL, or VBR_FAST
|
168
169
|
*/
|
169
|
-
static VALUE
|
170
|
+
static VALUE set_vbr_type(VALUE self, VALUE type) {
|
170
171
|
lame_global_flags * gfp;
|
171
172
|
|
172
173
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -180,7 +181,7 @@ static VALUE MpegEncoder_set_vbr_type(VALUE self, VALUE type) {
|
|
180
181
|
*
|
181
182
|
* Get the type of VBR.
|
182
183
|
*/
|
183
|
-
static VALUE
|
184
|
+
static VALUE get_vbr_type(VALUE self) {
|
184
185
|
lame_global_flags * gfp;
|
185
186
|
|
186
187
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -193,7 +194,7 @@ static VALUE MpegEncoder_get_vbr_type(VALUE self) {
|
|
193
194
|
*
|
194
195
|
* Print the encoder configuration.
|
195
196
|
*/
|
196
|
-
static VALUE
|
197
|
+
static VALUE print_config(VALUE self) {
|
197
198
|
lame_global_flags * gfp;
|
198
199
|
|
199
200
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -207,7 +208,7 @@ static VALUE MpegEncoder_print_config(VALUE self) {
|
|
207
208
|
*
|
208
209
|
* Set the ID3 artist.
|
209
210
|
*/
|
210
|
-
static VALUE
|
211
|
+
static VALUE set_artist(VALUE self, VALUE artist) {
|
211
212
|
lame_global_flags * gfp;
|
212
213
|
|
213
214
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -221,7 +222,7 @@ static VALUE MpegEncoder_set_artist(VALUE self, VALUE artist) {
|
|
221
222
|
*
|
222
223
|
* Set the ID3 title.
|
223
224
|
*/
|
224
|
-
static VALUE
|
225
|
+
static VALUE set_title(VALUE self, VALUE title) {
|
225
226
|
lame_global_flags * gfp;
|
226
227
|
|
227
228
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -235,7 +236,7 @@ static VALUE MpegEncoder_set_title(VALUE self, VALUE title) {
|
|
235
236
|
*
|
236
237
|
* Set the ID3 album.
|
237
238
|
*/
|
238
|
-
static VALUE
|
239
|
+
static VALUE set_album(VALUE self, VALUE album) {
|
239
240
|
lame_global_flags * gfp;
|
240
241
|
|
241
242
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -249,12 +250,11 @@ static VALUE MpegEncoder_set_album(VALUE self, VALUE album) {
|
|
249
250
|
*
|
250
251
|
* Set the ID3 year.
|
251
252
|
*/
|
252
|
-
static VALUE
|
253
|
+
static VALUE set_year(VALUE self, VALUE year) {
|
253
254
|
lame_global_flags * gfp;
|
254
|
-
VALUE * year_string;
|
255
255
|
|
256
256
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
257
|
-
year_string = rb_funcall(year, rb_intern("to_s"), 0);
|
257
|
+
VALUE year_string = rb_funcall(year, rb_intern("to_s"), 0);
|
258
258
|
id3tag_set_year(gfp, StringValuePtr(year_string));
|
259
259
|
return year;
|
260
260
|
}
|
@@ -265,17 +265,15 @@ static VALUE MpegEncoder_set_year(VALUE self, VALUE year) {
|
|
265
265
|
*
|
266
266
|
* Set the ID3 track.
|
267
267
|
*/
|
268
|
-
static VALUE
|
268
|
+
static VALUE set_track(VALUE self, VALUE track) {
|
269
269
|
lame_global_flags * gfp;
|
270
|
-
int track_number;
|
271
|
-
VALUE * track_string;
|
272
270
|
|
273
|
-
track_number = NUM2INT(track);
|
271
|
+
int track_number = NUM2INT(track);
|
274
272
|
if(track < 0 || track > 255)
|
275
273
|
rb_raise(rb_eRuntimeError, "Track must be between 0 and 255.\n");
|
276
274
|
|
277
275
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
278
|
-
track_string = rb_funcall(track, rb_intern("to_s"), 0);
|
276
|
+
VALUE track_string = rb_funcall(track, rb_intern("to_s"), 0);
|
279
277
|
id3tag_set_track(gfp, StringValuePtr(track_string));
|
280
278
|
return track;
|
281
279
|
}
|
@@ -286,7 +284,7 @@ static VALUE MpegEncoder_set_track(VALUE self, VALUE track) {
|
|
286
284
|
*
|
287
285
|
* Set the ID3 genre.
|
288
286
|
*/
|
289
|
-
static VALUE
|
287
|
+
static VALUE set_genre(VALUE self, VALUE genre) {
|
290
288
|
lame_global_flags * gfp;
|
291
289
|
|
292
290
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -302,7 +300,7 @@ static VALUE MpegEncoder_set_genre(VALUE self, VALUE genre) {
|
|
302
300
|
*
|
303
301
|
* Write the vbr tag
|
304
302
|
*/
|
305
|
-
static VALUE
|
303
|
+
static VALUE write_vbr_tag(VALUE self) {
|
306
304
|
lame_global_flags * gfp;
|
307
305
|
|
308
306
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -317,7 +315,7 @@ static VALUE MpegEncoder_write_vbr_tag(VALUE self) {
|
|
317
315
|
*
|
318
316
|
* Print the lame internals. For debugging
|
319
317
|
*/
|
320
|
-
static VALUE
|
318
|
+
static VALUE print_internals(VALUE self) {
|
321
319
|
lame_global_flags * gfp;
|
322
320
|
|
323
321
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -331,7 +329,7 @@ static VALUE MpegEncoder_print_internals(VALUE self) {
|
|
331
329
|
*
|
332
330
|
* Get the mpeg quality
|
333
331
|
*/
|
334
|
-
static VALUE
|
332
|
+
static VALUE get_mpeg_quality(VALUE self) {
|
335
333
|
lame_global_flags * gfp;
|
336
334
|
|
337
335
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -344,7 +342,7 @@ static VALUE MpegEncoder_get_mpeg_quality(VALUE self) {
|
|
344
342
|
*
|
345
343
|
* Get the mpeg compression ratio
|
346
344
|
*/
|
347
|
-
static VALUE
|
345
|
+
static VALUE get_compression_ratio(VALUE self) {
|
348
346
|
lame_global_flags * gfp;
|
349
347
|
|
350
348
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -357,7 +355,7 @@ static VALUE MpegEncoder_get_compression_ratio(VALUE self) {
|
|
357
355
|
*
|
358
356
|
* Get the mpeg version
|
359
357
|
*/
|
360
|
-
static VALUE
|
358
|
+
static VALUE get_mpeg_version(VALUE self) {
|
361
359
|
lame_global_flags * gfp;
|
362
360
|
|
363
361
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -370,7 +368,7 @@ static VALUE MpegEncoder_get_mpeg_version(VALUE self) {
|
|
370
368
|
*
|
371
369
|
* Get the mpeg mode
|
372
370
|
*/
|
373
|
-
static VALUE
|
371
|
+
static VALUE get_mpeg_mode(VALUE self) {
|
374
372
|
lame_global_flags * gfp;
|
375
373
|
|
376
374
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -383,7 +381,7 @@ static VALUE MpegEncoder_get_mpeg_mode(VALUE self) {
|
|
383
381
|
*
|
384
382
|
* Get the force ms flag
|
385
383
|
*/
|
386
|
-
static VALUE
|
384
|
+
static VALUE get_force_ms(VALUE self) {
|
387
385
|
lame_global_flags * gfp;
|
388
386
|
|
389
387
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -396,7 +394,7 @@ static VALUE MpegEncoder_get_force_ms(VALUE self) {
|
|
396
394
|
*
|
397
395
|
* Get the out samplerate
|
398
396
|
*/
|
399
|
-
static VALUE
|
397
|
+
static VALUE get_out_samplerate(VALUE self) {
|
400
398
|
lame_global_flags * gfp;
|
401
399
|
|
402
400
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -409,7 +407,7 @@ static VALUE MpegEncoder_get_out_samplerate(VALUE self) {
|
|
409
407
|
*
|
410
408
|
* Set the input samplerate
|
411
409
|
*/
|
412
|
-
static VALUE
|
410
|
+
static VALUE set_in_samplerate(VALUE self, VALUE samplerate) {
|
413
411
|
lame_global_flags * gfp;
|
414
412
|
|
415
413
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -423,7 +421,7 @@ static VALUE MpegEncoder_set_in_samplerate(VALUE self, VALUE samplerate) {
|
|
423
421
|
*
|
424
422
|
* Set the number of samples
|
425
423
|
*/
|
426
|
-
static VALUE
|
424
|
+
static VALUE set_num_samples(VALUE self, VALUE num_samples) {
|
427
425
|
lame_global_flags * gfp;
|
428
426
|
|
429
427
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -437,7 +435,7 @@ static VALUE MpegEncoder_set_num_samples(VALUE self, VALUE num_samples) {
|
|
437
435
|
*
|
438
436
|
* Get the number of samples
|
439
437
|
*/
|
440
|
-
static VALUE
|
438
|
+
static VALUE get_num_samples(VALUE self) {
|
441
439
|
lame_global_flags * gfp;
|
442
440
|
|
443
441
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -450,7 +448,7 @@ static VALUE MpegEncoder_get_num_samples(VALUE self) {
|
|
450
448
|
*
|
451
449
|
* Set the number of channels
|
452
450
|
*/
|
453
|
-
static VALUE
|
451
|
+
static VALUE set_num_channels(VALUE self, VALUE num_channels) {
|
454
452
|
lame_global_flags * gfp;
|
455
453
|
|
456
454
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -464,7 +462,7 @@ static VALUE MpegEncoder_set_num_channels(VALUE self, VALUE num_channels) {
|
|
464
462
|
*
|
465
463
|
* Get the number of channels
|
466
464
|
*/
|
467
|
-
static VALUE
|
465
|
+
static VALUE get_num_channels(VALUE self) {
|
468
466
|
lame_global_flags * gfp;
|
469
467
|
|
470
468
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -477,7 +475,7 @@ static VALUE MpegEncoder_get_num_channels(VALUE self) {
|
|
477
475
|
*
|
478
476
|
* Get the framesize
|
479
477
|
*/
|
480
|
-
static VALUE
|
478
|
+
static VALUE get_framesize(VALUE self) {
|
481
479
|
lame_global_flags * gfp;
|
482
480
|
|
483
481
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -490,7 +488,7 @@ static VALUE MpegEncoder_get_framesize(VALUE self) {
|
|
490
488
|
*
|
491
489
|
* Get the encoder buffer
|
492
490
|
*/
|
493
|
-
static VALUE
|
491
|
+
static VALUE encoder_buffer(VALUE self, VALUE left, VALUE right) {
|
494
492
|
unsigned char mp3buffer[LAME_MAXMP3BUFFER];
|
495
493
|
int * buffer_left;
|
496
494
|
int * buffer_right;
|
@@ -521,7 +519,7 @@ static VALUE MpegEncoder_encoder_buffer(VALUE self, VALUE left, VALUE right) {
|
|
521
519
|
else
|
522
520
|
rb_raise(rb_eRuntimeError, "internal error.\n");
|
523
521
|
}
|
524
|
-
return rb_str_new(mp3buffer, imp3);
|
522
|
+
return rb_str_new((const char *)mp3buffer, imp3);
|
525
523
|
}
|
526
524
|
|
527
525
|
/*
|
@@ -530,7 +528,7 @@ static VALUE MpegEncoder_encoder_buffer(VALUE self, VALUE left, VALUE right) {
|
|
530
528
|
*
|
531
529
|
* Flush the encoder
|
532
530
|
*/
|
533
|
-
static VALUE
|
531
|
+
static VALUE flush(VALUE self) {
|
534
532
|
unsigned char mp3buffer[LAME_MAXMP3BUFFER];
|
535
533
|
int imp3;
|
536
534
|
lame_global_flags * gfp;
|
@@ -543,7 +541,7 @@ static VALUE MpegEncoder_flush(VALUE self) {
|
|
543
541
|
else
|
544
542
|
rb_raise(rb_eRuntimeError, "internal error.\n");
|
545
543
|
}
|
546
|
-
return rb_str_new(mp3buffer, imp3);
|
544
|
+
return rb_str_new((const char *)mp3buffer, imp3);
|
547
545
|
}
|
548
546
|
|
549
547
|
/*
|
@@ -552,7 +550,7 @@ static VALUE MpegEncoder_flush(VALUE self) {
|
|
552
550
|
*
|
553
551
|
* Write the VBR tags to +outfile+
|
554
552
|
*/
|
555
|
-
static VALUE
|
553
|
+
static VALUE write_vbr_tags(VALUE self, VALUE outfile) {
|
556
554
|
OpenFile *fp;
|
557
555
|
lame_global_flags * gfp;
|
558
556
|
|
@@ -569,7 +567,7 @@ static VALUE MpegEncoder_write_vbr_tags(VALUE self, VALUE outfile) {
|
|
569
567
|
*
|
570
568
|
* Initialize lame parameters.
|
571
569
|
*/
|
572
|
-
static VALUE
|
570
|
+
static VALUE init_params(VALUE self) {
|
573
571
|
lame_global_flags * gfp;
|
574
572
|
|
575
573
|
Data_Get_Struct(self, lame_global_flags, gfp);
|
@@ -581,56 +579,50 @@ static VALUE MpegEncoder_init_params(VALUE self) {
|
|
581
579
|
return Qnil;
|
582
580
|
}
|
583
581
|
|
584
|
-
void
|
585
|
-
|
586
|
-
rb_mAudio = rb_define_module("Audio");
|
587
|
-
rb_mMpeg = rb_define_module_under(rb_mAudio, "MPEG");
|
588
|
-
|
589
|
-
/*
|
590
|
-
* Encode mp3s
|
591
|
-
*/
|
592
|
-
cMpegEncoder = rb_define_class_under(rb_mMpeg, "Encoder", rb_cObject);
|
582
|
+
void init_audio_mpeg_encoder()
|
583
|
+
{
|
584
|
+
VALUE rb_mAudio = rb_define_module("Audio");
|
585
|
+
VALUE rb_mMpeg = rb_define_module_under(rb_mAudio, "MPEG");
|
586
|
+
VALUE cMpegEncoder = rb_define_class_under(rb_mMpeg, "Encoder", rb_cObject);
|
593
587
|
rb_define_alloc_func(cMpegEncoder, encoder_allocate);
|
594
588
|
|
595
|
-
|
596
|
-
|
597
|
-
rb_define_method(cMpegEncoder, "
|
598
|
-
rb_define_method(cMpegEncoder, "
|
599
|
-
rb_define_method(cMpegEncoder, "
|
600
|
-
rb_define_method(cMpegEncoder, "
|
601
|
-
rb_define_method(cMpegEncoder, "
|
602
|
-
rb_define_method(cMpegEncoder, "
|
603
|
-
rb_define_method(cMpegEncoder, "
|
604
|
-
rb_define_method(cMpegEncoder, "
|
605
|
-
rb_define_method(cMpegEncoder, "
|
606
|
-
rb_define_method(cMpegEncoder, "
|
607
|
-
rb_define_method(cMpegEncoder, "
|
608
|
-
rb_define_method(cMpegEncoder, "
|
609
|
-
rb_define_method(cMpegEncoder, "
|
610
|
-
rb_define_method(cMpegEncoder, "
|
611
|
-
rb_define_method(cMpegEncoder, "
|
612
|
-
rb_define_method(cMpegEncoder, "
|
613
|
-
rb_define_method(cMpegEncoder, "
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
rb_define_private_method(cMpegEncoder, "
|
619
|
-
rb_define_private_method(cMpegEncoder, "
|
620
|
-
rb_define_private_method(cMpegEncoder, "
|
621
|
-
rb_define_private_method(cMpegEncoder, "
|
622
|
-
rb_define_private_method(cMpegEncoder, "
|
623
|
-
rb_define_private_method(cMpegEncoder, "
|
624
|
-
rb_define_private_method(cMpegEncoder, "
|
625
|
-
rb_define_private_method(cMpegEncoder, "
|
626
|
-
rb_define_private_method(cMpegEncoder, "
|
627
|
-
rb_define_private_method(cMpegEncoder, "
|
628
|
-
rb_define_private_method(cMpegEncoder, "
|
629
|
-
rb_define_private_method(cMpegEncoder, "
|
630
|
-
rb_define_private_method(cMpegEncoder, "
|
631
|
-
rb_define_private_method(cMpegEncoder, "
|
632
|
-
rb_define_private_method(cMpegEncoder, "
|
633
|
-
rb_define_private_method(cMpegEncoder, "
|
634
|
-
rb_define_private_method(cMpegEncoder, "print_internals", MpegEncoder_print_internals, 0);
|
635
|
-
rb_define_private_method(cMpegEncoder, "write_vbr_tag?", MpegEncoder_write_vbr_tag, 0);
|
589
|
+
rb_define_method(cMpegEncoder, "vbr_quality=",set_vbr_quality, 1);
|
590
|
+
rb_define_method(cMpegEncoder, "vbr_quality", get_vbr_quality, 0);
|
591
|
+
rb_define_method(cMpegEncoder, "vbr_type=", set_vbr_type, 1);
|
592
|
+
rb_define_method(cMpegEncoder, "vbr_type", get_vbr_type, 0);
|
593
|
+
rb_define_method(cMpegEncoder, "print_config", print_config, 0);
|
594
|
+
rb_define_method(cMpegEncoder, "title=", set_title, 1);
|
595
|
+
rb_define_method(cMpegEncoder, "artist=", set_artist, 1);
|
596
|
+
rb_define_method(cMpegEncoder, "album=", set_album, 1);
|
597
|
+
rb_define_method(cMpegEncoder, "year=", set_year, 1);
|
598
|
+
rb_define_method(cMpegEncoder, "track=", set_track, 1);
|
599
|
+
rb_define_method(cMpegEncoder, "genre=", set_genre, 1);
|
600
|
+
rb_define_method(cMpegEncoder, "bitrate=", set_bitrate, 1);
|
601
|
+
rb_define_method(cMpegEncoder, "bitrate", get_bitrate, 0);
|
602
|
+
rb_define_method(cMpegEncoder, "vbr_min_bitrate=", set_vbr_min_bitrate, 1);
|
603
|
+
rb_define_method(cMpegEncoder, "vbr_min_bitrate", get_vbr_min_bitrate, 0);
|
604
|
+
rb_define_method(cMpegEncoder, "vbr_max_bitrate=", set_vbr_max_bitrate, 1);
|
605
|
+
rb_define_method(cMpegEncoder, "vbr_max_bitrate", get_vbr_max_bitrate, 0);
|
606
|
+
rb_define_method(cMpegEncoder, "vbr_hard_min=", set_vbr_hard_min, 1);
|
607
|
+
rb_define_method(cMpegEncoder, "vbr_hard_min?", get_vbr_hard_min, 0);
|
608
|
+
|
609
|
+
|
610
|
+
rb_define_private_method(cMpegEncoder, "init_params", init_params, 0);
|
611
|
+
rb_define_private_method(cMpegEncoder, "num_channels=", set_num_channels, 1);
|
612
|
+
rb_define_private_method(cMpegEncoder, "num_channels", get_num_channels, 0);
|
613
|
+
rb_define_private_method(cMpegEncoder, "in_samplerate=", set_in_samplerate, 1);
|
614
|
+
rb_define_private_method(cMpegEncoder, "num_samples=", set_num_samples, 1);
|
615
|
+
rb_define_private_method(cMpegEncoder, "num_samples", get_num_samples, 0);
|
616
|
+
rb_define_private_method(cMpegEncoder, "out_samplerate", get_out_samplerate, 0);
|
617
|
+
rb_define_private_method(cMpegEncoder, "framesize", get_framesize, 0);
|
618
|
+
rb_define_private_method(cMpegEncoder, "encode_buffer", encoder_buffer, 2);
|
619
|
+
rb_define_private_method(cMpegEncoder, "flush", flush, 0);
|
620
|
+
rb_define_private_method(cMpegEncoder, "write_vbr_tags", write_vbr_tags, 1);
|
621
|
+
rb_define_private_method(cMpegEncoder, "force_ms", get_force_ms, 0);
|
622
|
+
rb_define_private_method(cMpegEncoder, "mpeg_mode", get_mpeg_mode, 0);
|
623
|
+
rb_define_private_method(cMpegEncoder, "mpeg_version", get_mpeg_version, 0);
|
624
|
+
rb_define_private_method(cMpegEncoder, "compression_ratio", get_compression_ratio, 0);
|
625
|
+
rb_define_private_method(cMpegEncoder, "mpeg_quality", get_mpeg_quality, 0);
|
626
|
+
rb_define_private_method(cMpegEncoder, "print_internals", print_internals, 0);
|
627
|
+
rb_define_private_method(cMpegEncoder, "write_vbr_tag?", write_vbr_tag, 0);
|
636
628
|
}
|