The cl-wav Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-wav Reference Manual

This is the cl-wav Reference Manual, version 0.0.1, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:27:31 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

cl-wav

Waveform audio file format (WAV files) uses Resource Interchange File Format (RIFF) to store audio.

This project provides a cross platform reader for the WAV file format, implemented in Common Lisp.

Optionally, you can customise the chunk data reader, for example see wrap-data-chunk-data-samples-reader to read the data as an array of float samples.

N.B. The data from WAV files can be quite long and can be very slow to print out in a REPL. You probably don't want to do that.

For large files or streamed files, you can use cl-riff read-riff-chunk to read chunks on demand, whilst still using the chunk-data-readers provided here.

N.B. cl-wav has only been tested with a limited range of WAV files.

Example

> (ql:quickload :cl-wav)
> (wav:read-wav-file "c:/windows/media/ding.wav")
...
> (second *)
(:CHUNK-ID "fmt " :CHUNK-DATA-SIZE 16 :CHUNK-DATA
(:COMPRESSION-CODE 1 :NUMBER-OF-CHANNELS 2 :SAMPLE-RATE 44100
:AVERAGE-BYTES-PER-SECOND 176400 :BLOCK-ALIGN 4 :SIGNIFICANT-BITS-PER-SAMPLE
16))
> (wav:read-wav-file "c:/windows/media/ding.wav" :chunk-data-reader (wav:wrap-data-chunk-data-samples-reader))
...

Limitations

Currently only supports reading files, not writing.

References

WAV, Wikipedia

Wave File Format, The Sonic Spot

Rob Blackwell
February 2014


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-wav

Author

Rob Blackwell

Description

Reads Wave Audio File Format, WAV files.

Version

0.0.1

Dependencies
Source

cl-wav.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-wav.asd

Location

cl-wav.asd

Systems

cl-wav (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-wav/package.lisp

Parent

cl-wav (system)

Location

package.lisp

Packages

wav


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 cl-wav/wav.lisp

Dependency

package.lisp (file)

Parent

cl-wav (system)

Location

wav.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 wav

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Constants

Constant: +experimental+
Package

wav

Source

wav.lisp (file)

Constant: +gsm-610+
Package

wav

Source

wav.lisp (file)

Constant: +ima-adpcm+
Package

wav

Source

wav.lisp (file)

Constant: +itu-g711-a-law+
Package

wav

Source

wav.lisp (file)

Constant: +itu-g711-mu-law+
Package

wav

Source

wav.lisp (file)

Constant: +itu-g721+adpcm+
Package

wav

Source

wav.lisp (file)

Constant: +itu-g723-adpcm-yamaha+
Package

wav

Source

wav.lisp (file)

Constant: +microsoft-adpcm+
Package

wav

Source

wav.lisp (file)

Constant: +mpeg+
Package

wav

Source

wav.lisp (file)

Constant: +pcmi-uncompressed+
Package

wav

Source

wav.lisp (file)

Constant: +unknown+
Package

wav

Source

wav.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: data-chunk-data-samples-reader STREAM CHUNK-ID CHUNK-DATA-SIZE

Returns an array of float samples by reading and converting the underlying data sample representation.

Package

wav

Source

wav.lisp (file)

Function: format-chunk-data-reader STREAM CHUNK-ID CHUNK-DATA-SIZE

Reads and parses the chunk-data from a format chunk.

Package

wav

Source

wav.lisp (file)

Function: read-wav-file FILESPEC &key CHUNK-DATA-READER

Reads a wav file from filespec.

Package

wav

Source

wav.lisp (file)

Function: wrap-data-chunk-data-samples-reader &optional CHUNK-DATA-READER

Creates a new chunk-data-reader function that wraps the supplied chunk-data-reader with the ability to read data chunks as floating point samples. Can be used as an alternative to the default chunk-data-reader when calling read-wav-file.

Package

wav

Source

wav.lisp (file)

Function: wrap-format-chunk-data-reader &optional CHUNK-DATA-READER

Creates a new chunk-data-reader function that wraps the supplied chunk-data-reader with the ability to parse format chunks.

Package

wav

Source

wav.lisp (file)

Function: write-wav-file CHUNKS FILESPEC &key CHUNK-DATA-WRITER
Package

wav

Source

wav.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *format-chunk*
Package

wav

Source

wav.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: format-chunk-data-writer CHUNK-DATA STREAM
Package

wav

Source

wav.lisp (file)

Function: read-s2 STREAM

Reads a 2 byte signed integer sample from stream.

Package

wav

Source

wav.lisp (file)

Function: read-s2-sample STREAM

Reads a 2 byte sample from stream, returning a corresponding float between -1.0 and 1.0.

Package

wav

Source

wav.lisp (file)

Function: read-u1-sample STREAM

Reads a 1 byte sample from stream, returning a corresponding float between -1.0 and 1.0.

Package

wav

Source

wav.lisp (file)

Function: s2-sample-data-chunk-reader STREAM CHUNK-ID CHUNK-DATA-SIZE

Returns an array of float samples corresponding to the 2 byte signed samples read from data chunk.

Package

wav

Source

wav.lisp (file)

Function: u1-sample-data-chunk-reader STREAM CHUNK-ID CHUNK-DATA-SIZE

Returns an array of float samples corresponding to the 1 byte samples read from data chunk.

Package

wav

Source

wav.lisp (file)

Function: wrap-format-chunk-data-writer &optional CHUNK-DATA-WRITER

Creates a new chunk-data-writer that wraps the supplied chunk-data-writer with the ability to emit format chunks.

Package

wav

Source

wav.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-wav.asd: The cl-wav<dot>asd file
cl-wav/package.lisp: The cl-wav/package<dot>lisp file
cl-wav/wav.lisp: The cl-wav/wav<dot>lisp file

F
File, Lisp, cl-wav.asd: The cl-wav<dot>asd file
File, Lisp, cl-wav/package.lisp: The cl-wav/package<dot>lisp file
File, Lisp, cl-wav/wav.lisp: The cl-wav/wav<dot>lisp file

L
Lisp File, cl-wav.asd: The cl-wav<dot>asd file
Lisp File, cl-wav/package.lisp: The cl-wav/package<dot>lisp file
Lisp File, cl-wav/wav.lisp: The cl-wav/wav<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   D   F   R   S   U   W  
Index Entry  Section

D
data-chunk-data-samples-reader: Exported functions

F
format-chunk-data-reader: Exported functions
format-chunk-data-writer: Internal functions
Function, data-chunk-data-samples-reader: Exported functions
Function, format-chunk-data-reader: Exported functions
Function, format-chunk-data-writer: Internal functions
Function, read-s2: Internal functions
Function, read-s2-sample: Internal functions
Function, read-u1-sample: Internal functions
Function, read-wav-file: Exported functions
Function, s2-sample-data-chunk-reader: Internal functions
Function, u1-sample-data-chunk-reader: Internal functions
Function, wrap-data-chunk-data-samples-reader: Exported functions
Function, wrap-format-chunk-data-reader: Exported functions
Function, wrap-format-chunk-data-writer: Internal functions
Function, write-wav-file: Exported functions

R
read-s2: Internal functions
read-s2-sample: Internal functions
read-u1-sample: Internal functions
read-wav-file: Exported functions

S
s2-sample-data-chunk-reader: Internal functions

U
u1-sample-data-chunk-reader: Internal functions

W
wrap-data-chunk-data-samples-reader: Exported functions
wrap-format-chunk-data-reader: Exported functions
wrap-format-chunk-data-writer: Internal functions
write-wav-file: Exported functions

Jump to:   D   F   R   S   U   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *   +  
C   S  
Index Entry  Section

*
*format-chunk*: Internal special variables

+
+experimental+: Exported constants
+gsm-610+: Exported constants
+ima-adpcm+: Exported constants
+itu-g711-a-law+: Exported constants
+itu-g711-mu-law+: Exported constants
+itu-g721+adpcm+: Exported constants
+itu-g723-adpcm-yamaha+: Exported constants
+microsoft-adpcm+: Exported constants
+mpeg+: Exported constants
+pcmi-uncompressed+: Exported constants
+unknown+: Exported constants

C
Constant, +experimental+: Exported constants
Constant, +gsm-610+: Exported constants
Constant, +ima-adpcm+: Exported constants
Constant, +itu-g711-a-law+: Exported constants
Constant, +itu-g711-mu-law+: Exported constants
Constant, +itu-g721+adpcm+: Exported constants
Constant, +itu-g723-adpcm-yamaha+: Exported constants
Constant, +microsoft-adpcm+: Exported constants
Constant, +mpeg+: Exported constants
Constant, +pcmi-uncompressed+: Exported constants
Constant, +unknown+: Exported constants

S
Special Variable, *format-chunk*: Internal special variables

Jump to:   *   +  
C   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S   W  
Index Entry  Section

C
cl-wav: The cl-wav system

P
Package, wav: The wav package

S
System, cl-wav: The cl-wav system

W
wav: The wav package

Jump to:   C   P   S   W