No matching definitions.

wav/info

src/wav/info.tur
defn

wav-open-read

(wav-open-read [path :cstr] :ptr<void>)

open a WAV/PCM/FLAC/AIFF file for reading.

pathfilesystem path to the audio file

(ok handle) on success; (err 0) if the file could not be opened. Pass handle as :int to wav/reader and wav/info functions. Free with wav-close when done.

(let [r (wav-open-read "sound.wav")]
    (if (ok? r) (let [w (ok-val r)] ...) (println "open failed")))

Since: WV0

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/writer and wav/info functions. Free with wav-close 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-close

(wav-close [w :int] :void)

close a WAV handle and free associated memory.

wWAV handle (ok-val from wav-open-read or wav-open-write)

void

(wav-close w)

Since: WV0

defn

wav-sample-rate

(wav-sample-rate [w :int] :int)

return the sample rate of an open WAV handle.

wWAV handle (ok-val from wav-open-read or wav-open-write)

Sample rate in Hz as :int.

(println (wav-sample-rate w))

Since: WV0

defn

wav-channels

(wav-channels [w :int] :int)

return the channel count of an open WAV handle.

wWAV handle (ok-val from wav-open-read or wav-open-write)

Number of channels as :int.

(println (wav-channels w))

Since: WV0

defn

wav-frame-count

(wav-frame-count [w :int] :int)

return the total frame count of an open WAV handle.

wWAV handle (ok-val from wav-open-read; 0 for write handles)

Total number of sample frames as :int.

(println (wav-frame-count w))

Since: WV0

defn

wav-format

(wav-format [w :int] :cstr)

return a string describing the container format.

wWAV handle (ok-val from wav-open-read or wav-open-write)

One of "wav", "aiff", "flac", or "unknown" as :cstr.

(println (wav-format w))

Since: WV0

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