Fix faultily written Xing frame

This commit is contained in:
Vanilagy
2025-09-19 14:03:46 +02:00
parent eb1ce86187
commit 88f9b64331
4 changed files with 14 additions and 9 deletions
+6 -1
View File
@@ -67,7 +67,12 @@ export class Mp3Writer {
const firstByte = 0xff;
const secondByte = 0xe0 | (data.mpegVersionId << 3) | (data.layer << 1);
const lowSamplingFrequency = data.mpegVersionId & 1;
let lowSamplingFrequency: number;
if (data.mpegVersionId & 2) {
lowSamplingFrequency = (data.mpegVersionId & 1) ? 0 : 1;
} else {
lowSamplingFrequency = 1;
}
const padding = 0;
const neededBytes = 155;