Encodes mono 16-bit frames as a FLAC stream (fLaC, STREAMINFO, then frames), lossless: the decoder returns exactly frames. rate goes into STREAMINFO; the MD5 field stays zero, which the format defines as "not computed".
fLaC
frames
rate
import { decodeFlac, encodeFlac } from '@datamoc/mwg/audio';const flac = encodeFlac(Int16Array.from([0, 100, 200, 100, 0]), 22050);console.log(decodeFlac(flac).rate); // 22050 Copy
import { decodeFlac, encodeFlac } from '@datamoc/mwg/audio';const flac = encodeFlac(Int16Array.from([0, 100, 200, 100, 0]), 22050);console.log(decodeFlac(flac).rate); // 22050
Encodes mono 16-bit frames as a FLAC stream (
fLaC, STREAMINFO, then frames), lossless: the decoder returns exactlyframes.rategoes into STREAMINFO; the MD5 field stays zero, which the format defines as "not computed".