Add toDataView

This commit is contained in:
Vanilagy
2025-01-26 12:03:23 +01:00
parent d3566305df
commit b759fd8808
4 changed files with 10 additions and 4 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { assert } from '../misc';
import { assert, toDataView } from '../misc';
import { Muxer } from '../muxer';
import { Output, OutputAudioTrack } from '../output';
import { EncodedAudioSample } from '../sample';
@@ -36,7 +36,7 @@ export class Mp3Muxer extends Muxer {
try {
if (!this.xingFrameData) {
const view = new DataView(sample.data.buffer, sample.data.byteOffset, sample.data.byteLength);
const view = toDataView(sample.data);
if (view.byteLength < 4) {
throw new Error('Invalid MP3 header in sample.');
}