This commit is contained in:
2025-04-16 16:37:11 +08:00
commit 2d29bcc489
12 changed files with 1277 additions and 0 deletions

2
demos/test-convert/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
files/*
!files/test.pcm

Binary file not shown.

View File

@@ -0,0 +1,12 @@
import { encodeWav, decodeWav } from '../../src/wav-converter';
import fs from 'fs';
const pcm = fs.readFileSync('./files/test.pcm');
const wav = encodeWav(pcm, {
sampleRate: 16000,
numChannels: 1,
byteRate: 16,
});
console.log(wav);
fs.writeFileSync('./files/test.wav', wav);