wavelet-audio ยป Using wavelet-audio
Generally you use just two functions: encode-wavelet-audio
and
decode-wavelet-audio
which convert between WAV files and
wavelet-audio (.wa) files. There is more advanced API. To encode
wavelet-audio stream you need to:
- Open bit stream for output using
trivial-bit-streams
.
You may wish to use
my
version of trivial-bit-streams
, which is faster. - Fill metadata block and write wavelet audio header using
write-wavelet-audio-header
. You need to specify a number of
channels, bits per sample and samplerate in streaminfo
block. - Feed audio data in form of
simple-array
of 32 bit signed
integer values to encode-block
along with streaminfo
metadata block. - Write audio blocks with
write-block
. - Flush and close bit stream.
To decode audio, you need to use counterparts to functions above:
open-wavelet-audio
, read-block
and decode-block
.