The cl-riff Reference Manual

Table of Contents

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

The cl-riff Reference Manual

This is the cl-riff Reference Manual, version 0.0.2, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 03:31:09 2018 GMT+0.


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

1 Introduction

cl-riff

The Resource Interchange File Format (RIFF) is a generic file container format for storing data in tagged chunks. It is primarily used to store multimedia such as sound and video, though it may also be used to store any arbitrary data.

I wrote this code as a cross-platform way of processing WAV audio files. (See cl-wav).

Use read-riff-file to load a whole file, returning it's content as a list of chunks, where each chunk is a plist.

Alternatively, open the stream yourself and call read-chunk successively until NIL.

Chunks are represented as plists, with accessor methods defined for chunk-id, chunk-data-size, chunk-data and file-type.

Example

> (ql:quickload :cl-riff)
> (riff:read-riff-file "c:/windows/media/ding.wav")
...
> (riff:riff-file-type (first *))
"WAVE"

> (riff:write-riff-file (riff:read-riff-file "c:/windows/media/ding.wav")
                        "c:/windows/media/ding-copy.wav")

References

Resource Interchange File Format, Wikipedia

Resource Interchange File Format Services, MSDN

Resource Interchange File Format (RIFF), MSDN

Contributors

Write functionality by Patrick Stein.


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-riff

Author

Rob Blackwell

Description

Reads Resource Interchange File Format (RIFF) files.

Version

0.0.2

Dependency

alexandria

Source

cl-riff.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-riff.asd

Location

cl-riff.asd

Systems

cl-riff (system)


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

3.1.2 cl-riff/package.lisp

Parent

cl-riff (system)

Location

package.lisp

Packages

riff


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

3.1.3 cl-riff/riff.lisp

Dependency

package.lisp (file)

Parent

cl-riff (system)

Location

riff.lisp

Exported Definitions
Internal Definitions

read-fourcc (function)


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

3.1.4 cl-riff/write.lisp

Dependency

riff.lisp (file)

Parent

cl-riff (system)

Location

write.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 riff

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 Functions

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

Reads chunk-data as an array of chunk-data-size bytes.

Package

riff

Source

riff.lisp (file)

Function: default-chunk-data-writer CHUNK-ID CHUNK-DATA STREAM &key START END

Writes chunk-data as an array of bytes.

Package

riff

Source

write.lisp (file)

Function: find-riff-chunk STREAM CHUNK-ID &key CHUNK-DATA-READER

Reads chunks from stream until a chunk with chunk-id is found, or NIL meaning not found.

Package

riff

Source

riff.lisp (file)

Function: read-riff-chunk STREAM &key CHUNK-DATA-READER

Reads a riff file chunk from stream and returns it as a plist or NIL if end of file.

Package

riff

Source

riff.lisp (file)

Function: read-riff-chunks STREAM &key CHUNK-DATA-READER

Reads all the chunks from stream until end of file. Returns a list of chunks.

Package

riff

Source

riff.lisp (file)

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

Reads a RIFF format file named by filespec, returning a list of chunks.

Package

riff

Source

riff.lisp (file)

Function: read-u2 STREAM

Reads a 2 byte little-endian integer from stream.

Package

riff

Source

riff.lisp (file)

Function: read-u4 STREAM

Reads a 4 byte little-endian integer from stream.

Package

riff

Source

riff.lisp (file)

Function: write-riff-chunk CHUNK-ID CHUNK-DATA STREAM &key CHUNK-DATA-WRITER START END

Writes a riff file chunk to stream.

Package

riff

Source

write.lisp (file)

Function: write-riff-chunks CHUNKS STREAM &key CHUNK-DATA-WRITER

Writes all the chunks to stream.

Package

riff

Source

write.lisp (file)

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

Writes a RIFF format file named by filespec from the given chunks.

Package

riff

Source

write.lisp (file)

Function: write-u2 U2 STREAM

Writes a 2 byte little-endian integer to stream.

Package

riff

Source

write.lisp (file)

Function: write-u4 U4 STREAM

Writes a 4 byte little-endian integer to stream.

Package

riff

Source

write.lisp (file)


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

5.1.2 Generic functions

Generic Function: riff-chunk-data CHUNK

Returns a byte array being the data in the riff chunk.

Package

riff

Source

riff.lisp (file)

Methods
Method: riff-chunk-data (CHUNK cons)
Generic Function: riff-chunk-data-end CHUNK
Package

riff

Methods
Method: riff-chunk-data-end CHUNK
Source

riff.lisp (file)

Generic Function: riff-chunk-data-size CHUNK

Returns the size of the riff chunk data.

Package

riff

Source

riff.lisp (file)

Methods
Method: riff-chunk-data-size (CHUNK cons)
Generic Function: riff-chunk-data-start CHUNK
Package

riff

Methods
Method: riff-chunk-data-start (CHUNK cons)
Source

riff.lisp (file)

Generic Function: riff-chunk-id CHUNK

Returns the chunk-id of a riff chunk - a four character Ascii tag.

Package

riff

Source

riff.lisp (file)

Methods
Method: riff-chunk-id (CHUNK cons)
Generic Function: riff-file-type CHUNK

Returns a four character riff file type - e.g. "WAVE"

Package

riff

Source

riff.lisp (file)

Methods
Method: riff-file-type (CHUNK cons)

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

5.2 Internal definitions


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

5.2.1 Functions

Function: read-fourcc STREAM

Reads a four character tag (FOURCC) from stream and returns it as an ASCII string. Returns NIL if end of file.

Package

riff

Source

riff.lisp (file)

Function: write-fourcc FOURCC STREAM

Writes a four character tag (FOURCC) to stream.

Package

riff

Source

write.lisp (file)

Function: write-riff-section CHUNK-ID SECTION-TYPE CHUNK-DATA-SIZE STREAM

Writes a riff subsection header to stream.

Package

riff

Source

write.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-riff.asd: The cl-riff<dot>asd file
cl-riff/package.lisp: The cl-riff/package<dot>lisp file
cl-riff/riff.lisp: The cl-riff/riff<dot>lisp file
cl-riff/write.lisp: The cl-riff/write<dot>lisp file

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

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

Jump to:   C   F   L  

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

A.2 Functions

Jump to:   D   F   G   M   R   W  
Index Entry  Section

D
default-chunk-data-reader: Exported functions
default-chunk-data-writer: Exported functions

F
find-riff-chunk: Exported functions
Function, default-chunk-data-reader: Exported functions
Function, default-chunk-data-writer: Exported functions
Function, find-riff-chunk: Exported functions
Function, read-fourcc: Internal functions
Function, read-riff-chunk: Exported functions
Function, read-riff-chunks: Exported functions
Function, read-riff-file: Exported functions
Function, read-u2: Exported functions
Function, read-u4: Exported functions
Function, write-fourcc: Internal functions
Function, write-riff-chunk: Exported functions
Function, write-riff-chunks: Exported functions
Function, write-riff-file: Exported functions
Function, write-riff-section: Internal functions
Function, write-u2: Exported functions
Function, write-u4: Exported functions

G
Generic Function, riff-chunk-data: Exported generic functions
Generic Function, riff-chunk-data-end: Exported generic functions
Generic Function, riff-chunk-data-size: Exported generic functions
Generic Function, riff-chunk-data-start: Exported generic functions
Generic Function, riff-chunk-id: Exported generic functions
Generic Function, riff-file-type: Exported generic functions

M
Method, riff-chunk-data: Exported generic functions
Method, riff-chunk-data-end: Exported generic functions
Method, riff-chunk-data-size: Exported generic functions
Method, riff-chunk-data-start: Exported generic functions
Method, riff-chunk-id: Exported generic functions
Method, riff-file-type: Exported generic functions

R
read-fourcc: Internal functions
read-riff-chunk: Exported functions
read-riff-chunks: Exported functions
read-riff-file: Exported functions
read-u2: Exported functions
read-u4: Exported functions
riff-chunk-data: Exported generic functions
riff-chunk-data: Exported generic functions
riff-chunk-data-end: Exported generic functions
riff-chunk-data-end: Exported generic functions
riff-chunk-data-size: Exported generic functions
riff-chunk-data-size: Exported generic functions
riff-chunk-data-start: Exported generic functions
riff-chunk-data-start: Exported generic functions
riff-chunk-id: Exported generic functions
riff-chunk-id: Exported generic functions
riff-file-type: Exported generic functions
riff-file-type: Exported generic functions

W
write-fourcc: Internal functions
write-riff-chunk: Exported functions
write-riff-chunks: Exported functions
write-riff-file: Exported functions
write-riff-section: Internal functions
write-u2: Exported functions
write-u4: Exported functions

Jump to:   D   F   G   M   R   W  

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

A.3 Variables


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

A.4 Data types

Jump to:   C   P   R   S  
Index Entry  Section

C
cl-riff: The cl-riff system

P
Package, riff: The riff package

R
riff: The riff package

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

Jump to:   C   P   R   S