zhuker/lamejs

Mp3's LAME Version Code is wrong

xiangyuecn opened this issue · 0 comments

Problem

The LAME information of the encoded MP3 file is garbled.

Bad data (MP3 HEX):

//LAME????????
4C 41 4D 45 03 00 09 08 00 04

Data that should have appeared:

//LAME3.98.4
4C 41 4D 45 33 2E 39 38 2E 34

How to solve

All charAt should be replaced with charCodeAt, because character selection Java and JS are different.

Major impact codes:

putbits2(gfc, version.charAt(i), 8);

charCodeAt should be used.