This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | RIFF_CHUNK_HEADER |
struct | FMT_CHUNK_HEADER |
struct | COMMON_CHUNK_HEADER |
struct | WAV |
Defines | |
#define | SWAP_WORD(w) (((w>>8)&0xff)|((w<<8)&0xff00)) |
#define | SWAP_LONG(l) |
#define | WAV_State_Hdr 0 |
#define | WAV_State_Data 1 |
Functions | |
void | kb_wav_init (WAV *wav) |
int | kb_wav_open (WAV *wav, const char *file, int read) |
void | kb_wav_close (WAV *wav) |
int | kb_wav_read_data (WAV *wav, void *buf, unsigned int size) |
int | kb_wav_write_data (WAV *wav, void *buf, unsigned int len) |
void | kb_wav_set_format (WAV *wav, unsigned short format, unsigned short nb_channel, unsigned long sample_rate, unsigned short bit_per_sample) |
int | kb_wav_read_hdr (WAV *wav, COMMON_CHUNK_HEADER *hdr) |
int | kb_wav_write_hdr (WAV *wav, COMMON_CHUNK_HEADER *hdr) |
void | kb_wav_dump_format (WAV *wav) |
|
Value:
Definition at line 9 of file kb_wav.h. Referenced by kb_wav_read_data(), kb_wav_read_hdr(), kb_wav_write_data(), and kb_wav_write_hdr(). |
|
Definition at line 8 of file kb_wav.h. Referenced by kb_wav_read_data(), kb_wav_read_hdr(), kb_wav_write_data(), and kb_wav_write_hdr(). |
|
|
|
|
|
This function closes a wav file.
Definition at line 161 of file kb_wav.c. References COMMON_CHUNK_HEADER::chunk, WAV::file, WAV::fmt, kb_wav_write_hdr(), WAV::length, COMMON_CHUNK_HEADER::length, WAV::modified, and COMMON_CHUNK_HEADER::type. Referenced by kb_wav_play(), koa_sound_task(), and main(). Here is the call graph for this function: |
|
This function dumps the wav file header to the standard output.
Definition at line 411 of file kb_wav.c. References FMT_CHUNK_HEADER::bit_per_sample, FMT_CHUNK_HEADER::byte_per_sample, FMT_CHUNK_HEADER::byte_per_sec, WAV::fmt, FMT_CHUNK_HEADER::format, FMT_CHUNK_HEADER::nb_channel, and FMT_CHUNK_HEADER::sample_rate. |
|
This function initializes the wav struct, it must be called before calling other wav functions.
Definition at line 91 of file kb_wav.c. References WAV::file, WAV::length, and WAV::modified. Referenced by kb_wav_play(), koa_sound_task(), and main(). |
|
This function opens a wav file for reading or writing
Definition at line 107 of file kb_wav.c. References COMMON_CHUNK_HEADER::chunk, WAV::file, WAV::fmt, kb_wav_read_hdr(), kb_wav_write_hdr(), COMMON_CHUNK_HEADER::length, WAV::length, WAV::modified, and COMMON_CHUNK_HEADER::type. Referenced by kb_wav_play(), koa_sound_task(), and main(). Here is the call graph for this function: |
|
This function reads a given number of data from a file opened with kb_wav_open. The resulting data are placed in buf and can be played using kb_snd_play.
Definition at line 197 of file kb_wav.c. References FMT_CHUNK_HEADER::byte_per_sample, WAV::file, WAV::fmt, SWAP_LONG, and SWAP_WORD. Referenced by kb_wav_play(), koa_sound_task(), and main(). |
|
This function reads Wave File header. Definition at line 306 of file kb_wav.c. References WAV::file, SWAP_LONG, and SWAP_WORD. Referenced by kb_wav_open(). |
|
Set the format for the given wav struct. The format is usually read from the wav file header using kb_wav_open. Definition at line 281 of file kb_wav.c. References FMT_CHUNK_HEADER::bit_per_sample, FMT_CHUNK_HEADER::byte_per_sample, FMT_CHUNK_HEADER::byte_per_sec, WAV::fmt, FMT_CHUNK_HEADER::format, WAV::modified, FMT_CHUNK_HEADER::nb_channel, and FMT_CHUNK_HEADER::sample_rate. |
|
This function writes some data into the file.
Definition at line 238 of file kb_wav.c. References FMT_CHUNK_HEADER::byte_per_sample, WAV::file, WAV::fmt, WAV::length, WAV::modified, SWAP_LONG, and SWAP_WORD. |
|
This function writes a header into a Wave File. Definition at line 360 of file kb_wav.c. References COMMON_CHUNK_HEADER::chunk, WAV::file, COMMON_CHUNK_HEADER::length, SWAP_LONG, SWAP_WORD, and COMMON_CHUNK_HEADER::type. Referenced by kb_wav_close(), and kb_wav_open(). |