Files
mediaplex/__test__/index.spec.mjs
T
2023-07-15 18:36:43 +05:45

17 lines
365 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');
t.deepEqual(probe(chunk), {
channels: 2,
sampleRate: 44100,
framesPerBlock: 0,
codec: 4099,
nFrames: 796032,
duration: 18
});
})