SPKit Utility Functions and Macros

These functions and macros are used by SPKit I/O classes. The functions are mostly dependent of the NeXT/Sun soundfile format. These are C functions and should be included to C++ code with
	extern "C" {
	#include ...
	}

Defined in <spkit/header.h>
SndHeader *newSndHeader(double samplingRate, int channelCount, int dataFormat)
allocates space for a new soundfile header and return a pointer to it. Returns NULL on error. The header memory must be freed after use with the ANSI C standard library free() function.

SndHeader is a C struct for NeXT/Sun soundfiles.

int getSndHeader(SndHeader **hp, FILE *fp)
reads a soundfile header from a file fp to hp. Space must be allocated before the call for the header, e.g. with newSndHeader().
int putSndHeader(SndHeader *hp, FILE *fp)
write the soundfile header poited to by hp to the file fp
Defined in <spkit/swapbyte.h>
swapInt16(x)
swap bytes of the 16-bit integer x
swapUint32(x)
change the byte order of the unsigned 32-bit integer x
Return to SPKit home

Kai Lassfolk / University of Helsinki / kpl@elisir.helsinki.fi