mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 10:53:50 +02:00
28 lines
574 B
TypeScript
28 lines
574 B
TypeScript
import { test } from 'vitest';
|
|
import { AudioSample, VideoSample } from '../../src/sample.js';
|
|
|
|
test('VideoSample creation from bytes', async () => {
|
|
const bytes = new Uint8Array(1024);
|
|
const sample = new VideoSample(bytes, {
|
|
codedWidth: 1280,
|
|
codedHeight: 720,
|
|
format: 'RGBA',
|
|
timestamp: 0,
|
|
});
|
|
|
|
sample.close();
|
|
});
|
|
|
|
test('AudioSample creation from bytes', async () => {
|
|
const bytes = new Uint8Array(1024);
|
|
const sample = new AudioSample({
|
|
data: bytes,
|
|
numberOfChannels: 2,
|
|
format: 's16',
|
|
sampleRate: 48000,
|
|
timestamp: 0,
|
|
});
|
|
|
|
sample.close();
|
|
});
|