mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-30 20:33:55 +02:00
Merge branch 'main' into v2
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { test } from 'vitest';
|
||||
import path from 'node:path';
|
||||
import { ALL_FORMATS, Input, FilePathSource, PacketCursor } from '../../src/index.js';
|
||||
|
||||
const __dirname = new URL('.', import.meta.url).pathname;
|
||||
|
||||
test('Should handle WAV file with oversized ID3 chunk', async () => {
|
||||
const filePath = path.join(__dirname, '..', 'public/oversized-id3.wav');
|
||||
using input = new Input({
|
||||
source: new FilePathSource(filePath),
|
||||
formats: ALL_FORMATS,
|
||||
});
|
||||
|
||||
const track = await input.getPrimaryAudioTrack();
|
||||
if (!track) {
|
||||
throw new Error('No audio track found');
|
||||
}
|
||||
|
||||
const cursor = new PacketCursor(track);
|
||||
|
||||
for await (const packet of cursor) {
|
||||
void packet;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user