There are three main types related to waveforms. A waveform is
stored in a structure defined as
typedef struct {
where sample_t is a float. To allow for a
control of the amount of memory used for I/O functions, I/Os are made
using a waveform buffer defined as
unsigned long n; /* number of samples */
sample_t *s; /* array of samples */
} spsig_t;
typedef struct {
Finally, waveform I/Os rely on the use of a waveform
stream whose corresponding structure is given by
unsigned long m; /* maximum number of samples */
unsigned long n; /* number of samples */
sample_t *s; /* array of samples */
} sigbuf_t;
typedef struct {
char *name; /* stream file name (NULL if stdin) */
void *f; /* input stream (FILE or SP_FILE) */
int format; /* stream format */
unsigned long nsamples; /* total number of samples in stream */
unsigned long nread; /* number of samples read */
float Fs; /* sample rate */
unsigned short nchannels; /* number of channels */
int nbps; /* bytes per samples and channel */
int swap; /* to swap or not to swap? */
sigbuf_t *buf; /* input buffer */
} sigstream_t;