![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include <stdio.h>#include <cstdint>

Go to the source code of this file.
Classes | |
| struct | wav_metadata |
Macros | |
| #define | WAV_HDR_PARSE_INVALID_PARAM 4 |
| #define | WAV_HDR_PARSE_NOT_PCM 3 |
| #define | WAV_HDR_PARSE_OK 0 |
| #define | WAV_HDR_PARSE_READ_ERROR 1 |
| #define | WAV_HDR_PARSE_WRONG_FORMAT 2 |
Functions | |
| const char * | get_wav_error (int errcode) |
| int | read_wav_header (FILE *wav_file, struct wav_metadata *metadata) |
| size_t | wav_read (void *buffer, size_t sample_count, FILE *wav_file, struct wav_metadata *metadata) |
| int | wav_seek (FILE *wav_file, long offset, int whence, struct wav_metadata *metadata) |
| same as fseek but WAV header presence is respected (for SEEK SET) | |
Definition in file wav_reader.h.
| #define WAV_HDR_PARSE_INVALID_PARAM 4 |
Definition at line 61 of file wav_reader.h.
Referenced by get_wav_error(), and read_fmt_chunk().
| #define WAV_HDR_PARSE_NOT_PCM 3 |
Definition at line 60 of file wav_reader.h.
Referenced by get_wav_error(), and read_fmt_chunk().
| #define WAV_HDR_PARSE_OK 0 |
Definition at line 57 of file wav_reader.h.
Referenced by audio_testcard_read_wav(), get_wav_error(), init_audio(), read_fmt_chunk(), and read_wav_header().
| #define WAV_HDR_PARSE_READ_ERROR 1 |
Definition at line 58 of file wav_reader.h.
Referenced by get_wav_error(), read_fmt_chunk(), and read_wav_header().
| #define WAV_HDR_PARSE_WRONG_FORMAT 2 |
Definition at line 59 of file wav_reader.h.
Referenced by get_wav_error(), read_fmt_chunk(), and read_wav_header().
| const char * get_wav_error | ( | int | errcode | ) |
Definition at line 300 of file wav_reader.c.
References LOG_LEVEL_ERROR, log_msg(), MOD_NAME, WAV_HDR_PARSE_INVALID_PARAM, WAV_HDR_PARSE_NOT_PCM, WAV_HDR_PARSE_OK, WAV_HDR_PARSE_READ_ERROR, and WAV_HDR_PARSE_WRONG_FORMAT.
Referenced by audio_testcard_read_wav(), and init_audio().

| int read_wav_header | ( | FILE * | wav_file, |
| struct wav_metadata * | metadata ) |
This function reads wav header
If read successfully, it leaves read file position at the beginning of data. Currently, only interleaved PCM is supported.
| WAV_HDR_PARSE_OK | if ok |
| WAV_HDR_PARSE_READ_ERROR | in case of file read error |
| WAV_HDR_PARSE_WRONG_FORMAT | if unsupported wav format |
| WAV_HDR_PARSE_NOT_PCM | non-PCM WAV detected |
< RF64 or BW64
Definition at line 215 of file wav_reader.c.
References CHECK, wav_metadata::data_offset, wav_metadata::data_size, fskip(), is_member(), LOG_LEVEL_ERROR, LOG_LEVEL_VERBOSE, LOG_LEVEL_WARNING, log_msg(), MOD_NAME, process_data_chunk(), read_ds64(), read_fmt_chunk(), READ_N, WAV_HDR_PARSE_OK, WAV_HDR_PARSE_READ_ERROR, and WAV_HDR_PARSE_WRONG_FORMAT.
Referenced by audio_testcard_read_wav(), and init_audio().

| size_t wav_read | ( | void * | buffer, |
| size_t | sample_count, | ||
| FILE * | wav_file, | ||
| struct wav_metadata * | metadata ) |
Reads sample_count samples from wav_file according to metadata.
Definition at line 291 of file wav_reader.c.
References wav_metadata::bits_per_sample, wav_metadata::ch_count, and signed2unsigned().
Referenced by audio_reading_thread(), and audio_testcard_read_wav().

| int wav_seek | ( | FILE * | wav_file, |
| long | offset, | ||
| int | whence, | ||
| struct wav_metadata * | metadata ) |
same as fseek but WAV header presence is respected (for SEEK SET)
Definition at line 319 of file wav_reader.c.
References wav_metadata::data_offset, and offset.
Referenced by audio_reading_thread(), and reset_import().