Hi!
> I noticed this encoding a 2 seconds wav from the end of a song:
> lame --abr 192 -h 1.wav 1.mp3
> lame --decode 1.mp3 2.wav
> The output from the decoding was:
> input: 1.mp3 44.1kHz MPEG1 2 channel LayerIII
> output: 2.wav (wav format)
> skipping initial 1104 samples (encoder + decoder delay)
> Frame# 66 [ 71] 80kbsmpg123: Can't rewind stream by 2 bits!
> mpg123: Can't rewind stream by 1 bits!
> Frame# 67 [ 71] 64kbsmpg123: Can't rewind stream by 2 bits!
> Frame# 70 [ 70] 80kbs
> The same error appears with mpg123. I'm using LAME 3.85. Is this
> normal? I found this in some other songs enconded.
Mmmh, try following:
1. Add a new function to file mpglib/common.c
void backbits( int number_of_bits )
{ bitindex -= number_of_bits;
wordpointer += (bitindex>>3);
bitindex &= 0x7;
}
2. declare it as extern in file mpglib/mpg123.h
extern void backbits( int number_of_bits );
3. replace the last few lines in file mpglib/layer3.c
function III_dequantize_sample(...)
u have
if(part2remain > 0)
getbits(part2remain);
else if(part2remain < 0) {
fprintf(stderr,"mpg123: Can't rewind stream by %d
bits!\n",-part2remain);
return 1; /* -> error */
}
u want
if(part2remain > 0)
getbits(part2remain);
else if(part2remain < 0) {
backbits(-part2remain);
}
4. recompile lame
hope this works
(at least for me for a couple of files)
markf
--
Sent through GMX FreeMail - http://www.gmx.net
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )