mirror of
https://github.com/darksaid98/mediaplex.git
synced 2026-12-01 14:38:45 +00:00
19 lines
450 B
JavaScript
19 lines
450 B
JavaScript
import test from 'ava'
|
|
import { probe } from '../index.js'
|
|
import { readFile } from 'fs/promises';
|
|
|
|
test('should probe mp3 buffer', async (t) => {
|
|
const chunk = await readFile('./__test__/data/head.mp3');
|
|
const probeResult = await probe(chunk);
|
|
|
|
t.deepEqual(probeResult, {
|
|
channels: 2,
|
|
sampleRate: 44100,
|
|
framesPerBlock: 0,
|
|
codec: 4099,
|
|
nFrames: 796032,
|
|
duration: 18,
|
|
metadata: probeResult.metadata.slice()
|
|
});
|
|
})
|