You are viewing an older revision! See the latest version
Wav_SD_Card_Read for RS EDP
Reading a wav file from an SD Card¶
This small program allows the user to input a filename for the .wav file he want to inspect.
After entering the file name the software will attempt to open the named file from the SD card and if successful will display the information contained in the header.
The header of a .wav file contains information such as the data rate, the number of audio channels (stereo/mon etc) plus the length of the file. This information is critical if the user want to attempt to play the wav file. By reading the sample rate information ofr example the software can be adjustment to read the data at the required rate.
The full information of the header file is read into a structure of th efollowing type:
struct wave_header_construction
{ sint8_t identification_block[5];
uint32_t length_of_file;
sint8_t identifier1[5];
sint8_t identifier2[5];
uint32_t position_of_data;
uint16_t format_tag;
uint16_t number_of_channels;
uint32_t samples_per_second;
uint32_t bytes_per_second;
uint16_t bytes_per_sample;
uint16_t bits_per_sample;
sint8_t marker[5];
uint32_t number_of_bits_in_sample;
} wave_file_info;