icanhasaudio 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/History.txt +6 -0
  2. data/Manifest.txt +24 -14
  3. data/README.txt +2 -0
  4. data/Rakefile +15 -8
  5. data/ext/icanhasaudio/audio_mpeg_decoder.c +220 -0
  6. data/ext/icanhasaudio/audio_mpeg_decoder.h +8 -0
  7. data/ext/icanhasaudio/audio_mpeg_decoder_mp3data.c +96 -0
  8. data/ext/icanhasaudio/audio_mpeg_decoder_mp3data.h +8 -0
  9. data/ext/{mpeg_encoder.c → icanhasaudio/audio_mpeg_encoder.c} +94 -102
  10. data/ext/icanhasaudio/audio_mpeg_encoder.h +8 -0
  11. data/ext/{rb_ogg.c → icanhasaudio/audio_ogg_decoder.c} +18 -9
  12. data/ext/icanhasaudio/audio_ogg_decoder.h +8 -0
  13. data/ext/{extconf.rb → icanhasaudio/extconf.rb} +2 -2
  14. data/ext/{get_audio.c → icanhasaudio/get_audio.c} +1 -6
  15. data/ext/{get_audio.h → icanhasaudio/get_audio.h} +2 -0
  16. data/ext/icanhasaudio/native.c +9 -0
  17. data/ext/icanhasaudio/native.h +21 -0
  18. data/ext/{rb_wav.c → icanhasaudio/rb_wav.c} +1 -2
  19. data/ext/{rb_wav.h → icanhasaudio/rb_wav.h} +1 -2
  20. data/lib/icanhasaudio.rb +4 -0
  21. data/lib/icanhasaudio/mpeg.rb +1 -24
  22. data/lib/icanhasaudio/mpeg/decoder.rb +95 -0
  23. data/lib/icanhasaudio/ogg.rb +1 -21
  24. data/lib/icanhasaudio/ogg/decoder.rb +31 -0
  25. data/lib/icanhasaudio/version.rb +8 -0
  26. data/lib/icanhasaudio/wav.rb +1 -0
  27. data/lib/icanhasaudio/wav/file.rb +62 -0
  28. data/test/assets/icha.mp3 +0 -0
  29. data/test/helper.rb +15 -0
  30. data/test/mpeg/test_decoder.rb +20 -0
  31. data/test/test_mpeg_encoder.rb +2 -4
  32. metadata +31 -18
  33. data/ext/decoder.c +0 -95
  34. data/ext/decoder.h +0 -3
  35. data/ext/icanhasaudio.c +0 -183
  36. data/ext/icanhasaudio.h +0 -8
  37. data/ext/mpeg_encoder.h +0 -10
  38. data/ext/syncword.c +0 -45
  39. data/ext/syncword.h +0 -3
@@ -1,9 +1,7 @@
1
- #include "mpeg_encoder.h"
2
- #include <rubyio.h>
1
+ #include <native.h>
3
2
 
4
- static VALUE cMpegEncoder;
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
- encoder_allocate(VALUE klass) {
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 MpegEncoder_set_vbr_hard_min(VALUE self, VALUE boolean) {
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 MpegEncoder_get_vbr_hard_min(VALUE self) {
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 MpegEncoder_set_vbr_max_bitrate(VALUE self, VALUE brate) {
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 MpegEncoder_get_vbr_max_bitrate(VALUE self) {
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 MpegEncoder_set_vbr_min_bitrate(VALUE self, VALUE brate) {
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 MpegEncoder_get_vbr_min_bitrate(VALUE self) {
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 MpegEncoder_set_bitrate(VALUE self, VALUE brate) {
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 MpegEncoder_get_bitrate(VALUE self) {
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 MpegEncoder_set_vbr_quality(VALUE self, VALUE quality) {
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 MpegEncoder_get_vbr_quality(VALUE self) {
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 MpegEncoder_set_vbr_type(VALUE self, VALUE type) {
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 MpegEncoder_get_vbr_type(VALUE self) {
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 MpegEncoder_print_config(VALUE self) {
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 MpegEncoder_set_artist(VALUE self, VALUE artist) {
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 MpegEncoder_set_title(VALUE self, VALUE title) {
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 MpegEncoder_set_album(VALUE self, VALUE album) {
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 MpegEncoder_set_year(VALUE self, VALUE year) {
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 MpegEncoder_set_track(VALUE self, VALUE track) {
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 MpegEncoder_set_genre(VALUE self, VALUE genre) {
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 MpegEncoder_write_vbr_tag(VALUE self) {
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 MpegEncoder_print_internals(VALUE self) {
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 MpegEncoder_get_mpeg_quality(VALUE self) {
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 MpegEncoder_get_compression_ratio(VALUE self) {
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 MpegEncoder_get_mpeg_version(VALUE self) {
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 MpegEncoder_get_mpeg_mode(VALUE self) {
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 MpegEncoder_get_force_ms(VALUE self) {
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 MpegEncoder_get_out_samplerate(VALUE self) {
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 MpegEncoder_set_in_samplerate(VALUE self, VALUE samplerate) {
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 MpegEncoder_set_num_samples(VALUE self, VALUE num_samples) {
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 MpegEncoder_get_num_samples(VALUE self) {
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 MpegEncoder_set_num_channels(VALUE self, VALUE num_channels) {
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 MpegEncoder_get_num_channels(VALUE self) {
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 MpegEncoder_get_framesize(VALUE self) {
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 MpegEncoder_encoder_buffer(VALUE self, VALUE left, VALUE right) {
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 MpegEncoder_flush(VALUE self) {
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 MpegEncoder_write_vbr_tags(VALUE self, VALUE outfile) {
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 MpegEncoder_init_params(VALUE self) {
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 init_MpegEncoder(VALUE rb_mMpeg) {
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
- /* Public Methods */
596
-
597
- rb_define_method(cMpegEncoder, "vbr_quality=",MpegEncoder_set_vbr_quality, 1);
598
- rb_define_method(cMpegEncoder, "vbr_quality", MpegEncoder_get_vbr_quality, 0);
599
- rb_define_method(cMpegEncoder, "vbr_type=", MpegEncoder_set_vbr_type, 1);
600
- rb_define_method(cMpegEncoder, "vbr_type", MpegEncoder_get_vbr_type, 0);
601
- rb_define_method(cMpegEncoder, "print_config", MpegEncoder_print_config, 0);
602
- rb_define_method(cMpegEncoder, "title=", MpegEncoder_set_title, 1);
603
- rb_define_method(cMpegEncoder, "artist=", MpegEncoder_set_artist, 1);
604
- rb_define_method(cMpegEncoder, "album=", MpegEncoder_set_album, 1);
605
- rb_define_method(cMpegEncoder, "year=", MpegEncoder_set_year, 1);
606
- rb_define_method(cMpegEncoder, "track=", MpegEncoder_set_track, 1);
607
- rb_define_method(cMpegEncoder, "genre=", MpegEncoder_set_genre, 1);
608
- rb_define_method(cMpegEncoder, "bitrate=", MpegEncoder_set_bitrate, 1);
609
- rb_define_method(cMpegEncoder, "bitrate", MpegEncoder_get_bitrate, 0);
610
- rb_define_method(cMpegEncoder, "vbr_min_bitrate=", MpegEncoder_set_vbr_min_bitrate, 1);
611
- rb_define_method(cMpegEncoder, "vbr_min_bitrate", MpegEncoder_get_vbr_min_bitrate, 0);
612
- rb_define_method(cMpegEncoder, "vbr_max_bitrate=", MpegEncoder_set_vbr_max_bitrate, 1);
613
- rb_define_method(cMpegEncoder, "vbr_max_bitrate", MpegEncoder_get_vbr_max_bitrate, 0);
614
- rb_define_method(cMpegEncoder, "vbr_hard_min=", MpegEncoder_set_vbr_hard_min, 1);
615
- rb_define_method(cMpegEncoder, "vbr_hard_min?", MpegEncoder_get_vbr_hard_min, 0);
616
-
617
-
618
- rb_define_private_method(cMpegEncoder, "init_params", MpegEncoder_init_params, 0);
619
- rb_define_private_method(cMpegEncoder, "num_channels=", MpegEncoder_set_num_channels, 1);
620
- rb_define_private_method(cMpegEncoder, "num_channels", MpegEncoder_get_num_channels, 0);
621
- rb_define_private_method(cMpegEncoder, "in_samplerate=", MpegEncoder_set_in_samplerate, 1);
622
- rb_define_private_method(cMpegEncoder, "num_samples=", MpegEncoder_set_num_samples, 1);
623
- rb_define_private_method(cMpegEncoder, "num_samples", MpegEncoder_get_num_samples, 0);
624
- rb_define_private_method(cMpegEncoder, "out_samplerate", MpegEncoder_get_out_samplerate, 0);
625
- rb_define_private_method(cMpegEncoder, "framesize", MpegEncoder_get_framesize, 0);
626
- rb_define_private_method(cMpegEncoder, "encode_buffer", MpegEncoder_encoder_buffer, 2);
627
- rb_define_private_method(cMpegEncoder, "flush", MpegEncoder_flush, 0);
628
- rb_define_private_method(cMpegEncoder, "write_vbr_tags", MpegEncoder_write_vbr_tags, 1);
629
- rb_define_private_method(cMpegEncoder, "force_ms", MpegEncoder_get_force_ms, 0);
630
- rb_define_private_method(cMpegEncoder, "mpeg_mode", MpegEncoder_get_mpeg_mode, 0);
631
- rb_define_private_method(cMpegEncoder, "mpeg_version", MpegEncoder_get_mpeg_version, 0);
632
- rb_define_private_method(cMpegEncoder, "compression_ratio", MpegEncoder_get_compression_ratio, 0);
633
- rb_define_private_method(cMpegEncoder, "mpeg_quality", MpegEncoder_get_mpeg_quality, 0);
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
  }