WAV PCM decoder.
Copyright (c) 2009-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | PCM_COMP_CODE 0x1 |
Tag for PCM format. More... | |
#define | TAG_RIFF 0x52494646 |
#define | TAG_WAVE 0x57415645 |
#define | TAG_FMT 0x666D7420 |
#define | TAG_DATA 0x64617461 |
Functions | |
static bool | pcm_decode (struct wav_info_t *wav_info) |
Decode a buffer of OUTPUT_BUFFER_SIZE bytes from the WAV PCM file. More... | |
bool | wav_decode (struct wav_info_t *wav_info) |
Decode a buffer of OUTPUT_BUFFER_SIZE bytes from the WAV file. More... | |
bool | wav_decode_end (struct wav_info_t *wav_info) |
End the decoding, clean remaining buffers. More... | |
uint32_t | wav_get_duration_s (struct wav_info_t *wav_info) |
Get the duration of a WAV file in seconds. More... | |
bool | wav_header_decode (struct wav_info_t *wav_info) |
Decode the header of a WAV file. This function will fill the wav_info_t structure passed in argument to this function. More... | |
static bool | get_wav_data (struct wav_info_t *wav_info, uint8_t *data, uint8_t nbbyte) |
static bool | get_wav_byte (struct wav_info_t *wav_info, uint8_t *data8) |
static uint16_t | conv16little2big (uint16_t i) |
static uint32_t | conv32little2big (uint32_t i) |
Variables | |
bool(* | p_decode_fct )(struct wav_info_t *) |
#define PCM_COMP_CODE 0x1 |
Tag for PCM format.
Referenced by wav_header_decode().
#define TAG_DATA 0x64617461 |
Referenced by wav_header_decode().
#define TAG_FMT 0x666D7420 |
Referenced by wav_header_decode().
#define TAG_RIFF 0x52494646 |
Tags to delimit sections in the WAV file format.
Referenced by wav_header_decode().
#define TAG_WAVE 0x57415645 |
Referenced by wav_header_decode().
|
static |
Referenced by wav_header_decode().
|
static |
Referenced by wav_header_decode().
|
static |
References wav_info_t::buffer_current_pos, wav_info_t::in_buffer_left, and wav_file_get_data().
Referenced by pcm_decode().
|
static |
Helper functions
References wav_info_t::buffer_current_pos, wav_info_t::in_buffer_left, and wav_file_get_data().
Referenced by wav_header_decode().
|
static |
Decode a buffer of OUTPUT_BUFFER_SIZE bytes from the WAV PCM file.
wav_info | the wav_info_t structure describing the file of interest. |
References wav_info_t::bits_per_sample, get_wav_byte(), OUTPUT_BUFFER_SIZE, wav_info_t::pcm_samples, and wav_info_t::pcm_samples_length.
Referenced by wav_header_decode().
bool(* p_decode_fct)(struct wav_info_t *) |
Referenced by wav_decode(), and wav_header_decode().