Data Structures | Functions

src/io_wav.h File Reference

STATUS: work in progress WAV file input-output for (EEG)-data. More...

#include <stdint.h>
#include <stdio.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  WavFile

Functions

void wavfile_free (WavFile *w)
 free WavFile struct and data.
void wavfile_print (FILE *out, WavFile *w)
 list content of WavFile struct.
WavFilewavfile_read (FILE *f)
 read WAV-File.
int wavfile_write (WavFile *w, const char *fname)
 write WAV-File.

Detailed Description

STATUS: work in progress WAV file input-output for (EEG)-data.

The WAV-file format allows multi-channel output. Writing the EEG-data to WAV is a convenient way for visualizing the data in an audio-visualizer software (e.g. Audacity).

For writing the WAV file, some parameters need to be passed to the WavFile struct:

Todo:
implement matrix-to-wavfile conversion

Definition in file io_wav.h.


Function Documentation

void wavfile_free ( WavFile w  ) 

free WavFile struct and data.

Parameters:
w the WavFile struct

Definition at line 45 of file io_wav.c.

void wavfile_print ( FILE *  out,
WavFile w 
)

list content of WavFile struct.

Parameters:
out the output stream (e.g. stderr)
w the wavfile struct

Definition at line 28 of file io_wav.c.

WavFile* wavfile_read ( FILE *  f  ) 

read WAV-File.

see https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ for details on the wav-file format

Parameters:
f a FILE pointer
Returns:
the wavfile (freshly allocated) or NULL (failure)

Definition at line 63 of file io_wav.c.

int wavfile_write ( WavFile w,
const char *  fname 
)

write WAV-File.

see https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ for details on the wav-file format

Parameters:
w the wavfile
fname the name of the output file
Returns:
0 success, else failure

Definition at line 117 of file io_wav.c.