Class: Audio::MPEG::Decoder::MP3Data

Inherits:
Object
  • Object
show all
Defined in:
ext/icanhasaudio/audio_mpeg_decoder_mp3data.c

Instance Method Summary collapse

Instance Method Details

#bitrateObject

Get the bitrate



24
25
26
27
28
29
# File 'ext/icanhasaudio/audio_mpeg_decoder_mp3data.c', line 24

static VALUE bitrate(VALUE self)
{
  mp3data_struct * mp3data;
  Data_Get_Struct(self, mp3data_struct, mp3data);
  return INT2NUM(mp3data->bitrate);
}

#header_parsed?Boolean

Has the mp3 header been parsed yet?

Returns:

  • (Boolean)


9
10
11
12
13
14
15
16
# File 'ext/icanhasaudio/audio_mpeg_decoder_mp3data.c', line 9

static VALUE header_parsed_eh(VALUE self)
{
  mp3data_struct * mp3data;
  Data_Get_Struct(self, mp3data_struct, mp3data);

  if(mp3data->header_parsed == 1) return Qtrue;
  return Qfalse;
}

#nsampObject

Get the number of samples



50
51
52
53
54
55
# File 'ext/icanhasaudio/audio_mpeg_decoder_mp3data.c', line 50

static VALUE get_nsamp(VALUE self)
{
  mp3data_struct * mp3data;
  Data_Get_Struct(self, mp3data_struct, mp3data);
  return LONG2NUM(mp3data->nsamp);
}

#nsamp=(num) ⇒ Object

Set the number of samples to num



63
64
65
66
67
68
69
# File 'ext/icanhasaudio/audio_mpeg_decoder_mp3data.c', line 63

static VALUE set_nsamp(VALUE self, VALUE num)
{
  mp3data_struct * mp3data;
  Data_Get_Struct(self, mp3data_struct, mp3data);
  mp3data->nsamp = NUM2LONG(num);
  return num;
}

#total_framesObject

Get the total frames for this mp3



37
38
39
40
41
42
# File 'ext/icanhasaudio/audio_mpeg_decoder_mp3data.c', line 37

static VALUE total_frames(VALUE self)
{
  mp3data_struct * mp3data;
  Data_Get_Struct(self, mp3data_struct, mp3data);
  return INT2NUM(mp3data->totalframes);
}