Audio-MPEG
view release on metacpan or search on metacpan
err++;
break;
}
}
}
if (MAD_RECOVERABLE(stream->error))
err = 0;
if (!err) {
THIS->current_frame++;
THIS->accum_bitrate += header->bitrate / 1000;
mad_timer_add(&THIS->total_duration, header->duration);
}
XSRETURN_YES;
#
# Create PCM stream (in mad_fixed_t type) from decoded frame
#
void
synth_frame(THIS)
Audio_MPEG_Decode THIS
Audio_MPEG_Decode THIS
CODE:
RETVAL = THIS->current_frame;
OUTPUT:
RETVAL
double
frame_duration(THIS)
Audio_MPEG_Decode THIS
CODE:
RETVAL = (double)mad_timer_count(THIS->frame->header.duration,
MAD_UNITS_MILLISECONDS) / 1000.0;
OUTPUT:
RETVAL
double
total_duration(THIS)
Audio_MPEG_Decode THIS
CODE:
RETVAL = (double)mad_timer_count(THIS->total_duration,
MAD_UNITS_MILLISECONDS) / 1000.0;
OUTPUT:
RETVAL
unsigned int
bit_rate(THIS)
Audio_MPEG_Decode THIS
CODE:
RETVAL = THIS->frame->header.bitrate / 1000;
OUTPUT:
#include "resample.h"
struct audio_mpeg_decode {
struct mad_stream *stream;
struct mad_frame *frame;
struct mad_synth *synth;
unsigned char *data_in;
size_t data_in_len;
unsigned int current_frame;
unsigned long accum_bitrate;
mad_timer_t total_duration;
};
typedef struct audio_mpeg_decode * Audio_MPEG_Decode;
/* samples that are blank */
#define MP3_DECODE_DELAY 578
void decode_new(Audio_MPEG_Decode);
void decode_DESTROY(Audio_MPEG_Decode);
char const *decode_error_str(enum mad_error);
int decode_buffer(Audio_MPEG_Decode, unsigned char *, size_t);
( run in 0.538 second using v1.01-cache-2.11-cpan-49f99fa48dc )