No matching definitions.

wav/writer

src/wav/writer.tur
defn

wav-open-write

(wav-open-write [path :cstr sample-rate :int channels :int format :cstr] :ptr<void>)

open a new audio file for writing.

pathfilesystem path for the new audio file
sample-ratesample rate in Hz (e.g. 44100)
channelsnumber of channels (e.g. 1 for mono, 2 for stereo)
formatformat keyword: ":wav-pcm16", ":wav-pcm24", ":wav-pcm32",
":wav-float", ":aiff-pcm16", ":flac-pcm16", ":flac-pcm24"

(ok handle) on success; (err 0) if the file could not be created. Pass handle as :int to wav-write-float. Free with wav-close from wav/info when done.

(let [r (wav-open-write "/tmp/out.wav" 44100 2 ":wav-pcm16")]
    (if (ok? r) (let [w (ok-val r)] ...) (println "open failed")))

Since: WV0

defn

wav-write-float

(wav-write-float [w :int buf :cstr frames :int] :int)

write interleaved float samples to an open WAV handle.

wWAV handle (ok-val from wav-open-write)
bufpointer to a float buffer, passed as :cstr (cast to const float*)
framesnumber of sample frames to write

Number of frames actually written as :int.

(let [n (wav-write-float w buf 1024)]
    (println n))

Since: WV0

Internal definitions
__ok-- create an ok result wrapping integer value v.
__err-- create an err result wrapping integer error value e.