No matching definitions.

wav/info

src/wav/info.tur
defopaque

Wav

(Wav)

WAV/audio file handle.

Since: 0.2.0

defn

wav-open-read

(wav-open-read [path : cstr] :)

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

pathfilesystem path to the audio file

(Result Wav int) -- ok carries the Wav handle; err carries 0 if the file could not be opened. 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] :)

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"

(Result Wav int) -- ok carries the Wav handle; err carries 0 if the file could not be created. 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 : Wav] :)

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 : Wav] :)

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 : Wav] :)

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 : Wav] :)

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 : Wav] :)

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