wav.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* This header file defines the .wav audio file format.
*/
#ifndef _WAV_H
#define _WAV_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Define the on-disk audio file header for the .wav file format.
* By definition .wav files are little endian. Macros are provided
* to make the conversion easier.
*
* The .wav format is one of the variations of the RIFF format. To
* that end it contains a RIFF header chunk, a type chunk, a format
* chunk, and then one or more data chunks. The following illustrates
* the format:
*
* RIFF <Length of data> RIFF header chunk
* WAVE type chunk
* fmt<sp> format chunk
* DATA <Length of data> <data> data chunk (one or more)
*
* Since the RIFF headers never change for a .wav file there's no real reason
* to separate the header into the different chunks. Thus a single header
* structure is defined for the header.
*
* When building a .wav header the size of the data isn't always known.
* The following define is used for that situation.
*/
#define AUDIO_WAV_UNKNOWN_SIZE (~0)
struct wav_filehdr {
};
typedef struct wav_filehdr wav_filehdr_t;
/* define for wav_filehdr.wav_riff_ID */
/* define for wav_filehdr.wav_wave_ID */
/* define for wav_filehdr.wav_fmt_ID */
/* define for wav_filehdr.wav_fmt_size */
/* defines for wav_filehdr.wav_fmt_encoding */
#define AUDIO_WAV_FMT_ENCODING_UNKNOWN 0x0000
#define AUDIO_WAV_FMT_ENCODING_PCM 0x0001
#define AUDIO_WAV_FMT_ENCODING_MS_ADPCM 0x0002
#define AUDIO_WAV_FMT_ENCODING_ALAW 0x0006
#define AUDIO_WAV_FMT_ENCODING_MULAW 0x0007
#define AUDIO_WAV_FMT_ENCODING_DVI_ADPCM 0x0011
/* defines for wav_filehdr.wav_fmt_channels */
#define AUDIO_WAV_FMT_CHANNELS_MONO 0
#define AUDIO_WAV_FMT_CHANNELS_STEREO 1
/* defines for wav_filehdr.wav_fmt_bytes_per_sample */
/* defines for wav_filehdr.wav_fmt_bits_per_sample */
#define AUDIO_WAV_FMT_BITS_PER_SAMPLE_8_BITS 8
#define AUDIO_WAV_FMT_BITS_PER_SAMPLE_16_BITS 16
/* defines for wav_filehdr.wav_data_ID */
/* byte swapping macros */
#if defined(__sparc) /* big endian */
#else
#endif /* byte swapping */
#ifdef __cplusplus
}
#endif
#endif /* _WAV_H */