A C++ library for accessing RIFF/PCM audio files

libwavstream is a C++ library that contains the definition of the wavstream class. It provides public methods for read, write and create 16-bit audio files in Microsoft RIFF/PCM format. No compression is supported and no 8-bit files handling is implemented. This class reads, writes and updates file headers, implementing optional strong checking of header consistency. Header generated by a wavstream object are fully standard compliant.

libwavstream manages file searching in a set of default directories (like many unix shells do). You can specify the desired set of (colon separated) directory in the WAVSTREAMPATH environment variable. When, during a file opening, wavstream can not find the specified file name, it checks all default directories. At the time this feature can't be disabled.

Mixed access (R/W) opening mode are supported as well as mixed read/write operations. wavstream uses a distinct file pointer for each kind of operation.

wavstream class has no public member variables. All manipulations take place via these public member functions.

On error, all methods print a panic message on standard error stream and terminate unsuccessfully returning -1.

Once opened a wavstream, one can obtain informations on it by calling these methods:

All these methods returns wavstream::ERRNOHDR if the wavstream object has no defined header at call time.

NOTE: This library is no longer useful to me, so there will be no updates.

Here you can find gzipped libwavstream source code and binaries.