Group PJMEDIA_WAVE

group PJMEDIA_WAVE

Representation of RIFF/WAVE file format.

This the the low level representation of RIFF/WAVE file format. For higher abstraction, please see WAV File Player and File Writer (Recorder).

Defines

PJMEDIA_RIFF_TAG

Standard RIFF tag to identify RIFF file format in the WAVE header.

PJMEDIA_WAVE_TAG

Standard WAVE tag to identify WAVE header.

PJMEDIA_FMT_TAG

Standard FMT tag to identify format chunks.

PJMEDIA_DATA_TAG

Standard DATA tag to identify data chunks.

PJMEDIA_FACT_TAG

Standard FACT tag to identify fact chunks.

PJMEDIA_WAVE_NORMALIZE_SUBCHUNK(ch)

Normalize subchunk header from little endian (the representation of RIFF file) into host’s endian.

Enums

enum pjmedia_wave_fmt_tag

Enumeration of format compression tag.

Values:

enumerator PJMEDIA_WAVE_FMT_TAG_PCM
enumerator PJMEDIA_WAVE_FMT_TAG_ALAW
enumerator PJMEDIA_WAVE_FMT_TAG_ULAW

Functions

void pjmedia_wave_hdr_file_to_host(pjmedia_wave_hdr *hdr)

On big-endian hosts, this function swaps the byte order of the values in the WAVE header fields. On little-endian hosts, this function does nothing.

Application SHOULD call this function after reading the WAVE header chunks from a file.

Parameters:

hdr – The WAVE header.

void pjmedia_wave_hdr_host_to_file(pjmedia_wave_hdr *hdr)

On big-endian hosts, this function swaps the byte order of the values in the WAVE header fields. On little-endian hosts, this function does nothing.

Application SHOULD call this function before writing the WAVE header to a file.

Parameters:

hdr – The WAVE header.

struct pjmedia_wave_hdr
#include <wave.h>

This file describes the simpler/canonical version of a WAVE file. It does not support the full RIFF format specification.

See also

pjmedia_wave_hdr

Public Members

pj_uint32_t riff

“RIFF” ASCII tag.

pj_uint32_t file_len

File length minus 8 bytes

pj_uint32_t wave

“WAVE” ASCII tag.

struct pjmedia_wave_hdr::[anonymous] riff_hdr

This structure describes RIFF WAVE file header

pj_uint32_t fmt

“fmt “ ASCII tag.

pj_uint32_t len

16 for PCM.

Data length.

pj_uint16_t fmt_tag

1 for PCM

pj_uint16_t nchan

Number of channels.

pj_uint32_t sample_rate

Sampling rate.

pj_uint32_t bytes_per_sec

Average bytes per second.

pj_uint16_t block_align

nchannels * bits / 8

pj_uint16_t bits_per_sample

Bits per sample.

struct pjmedia_wave_hdr::[anonymous] fmt_hdr

This structure describes format chunks/header

pj_uint32_t data

“data” ASCII tag.

struct pjmedia_wave_hdr::[anonymous] data_hdr

The data header preceeds the actual data in the file.

struct pjmedia_wave_subchunk
#include <wave.h>

This structure describes generic RIFF subchunk header.

Public Members

pj_uint32_t id

Subchunk ASCII tag.

pj_uint32_t len

Length following this field