156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks/*---------------------------------------------------------------------------- 256c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * 356c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * File: 456c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * eas_wave.h 556c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * 656c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * Contents and purpose: 756c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * Writes output to a .WAV file 856c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * 956c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * DO NOT MODIFY THIS FILE! 1056c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * 1156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * Copyright Sonic Network Inc. 2005 127df30109963092559d3760c0661a020f9daf1030The Android Open Source Project 137df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License"); 147df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * you may not use this file except in compliance with the License. 157df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * You may obtain a copy of the License at 167df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * 177df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * http://www.apache.org/licenses/LICENSE-2.0 187df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * 197df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * Unless required by applicable law or agreed to in writing, software 207df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS, 217df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 227df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * See the License for the specific language governing permissions and 237df30109963092559d3760c0661a020f9daf1030The Android Open Source Project * limitations under the License. 2456c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks *---------------------------------------------------------------------------- 2556c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * Revision Control: 2656c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * $Revision: 82 $ 2756c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 2856c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks *---------------------------------------------------------------------------- 2956c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks*/ 3056c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 3156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks#include "eas_types.h" 3256c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 3356c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks/* sentinel */ 3456c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks#ifndef _EAS_WAVE_H 3556c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks#define _EAS_WAVE_H 3656c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 3756c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks/* .WAV file format chunk */ 3856c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparkstypedef struct { 3956c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_U16 wFormatTag; 4056c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_U16 nChannels; 4156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_U32 nSamplesPerSec; 4256c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_U32 nAvgBytesPerSec; 4356c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_U16 nBlockAlign; 4456c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_U16 wBitsPerSample; 4556c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks} FMT_CHUNK; 4656c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 4756c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks/* .WAV file header */ 4856c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparkstypedef struct { 4956c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_U32 nRiffTag; 5056c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_U32 nRiffSize; 5156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_U32 nWaveTag; 5256c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_U32 nFmtTag; 5356c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_U32 nFmtSize; 5456c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks FMT_CHUNK fc; 5556c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_U32 nDataTag; 5656c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_U32 nDataSize; 5756c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks} WAVE_HEADER; 5856c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 5956c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparkstypedef struct { 6056c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks WAVE_HEADER wh; 6156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks FILE *file; 6256c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_BOOL write; 6356c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks EAS_U32 dataSize; 6456c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks} WAVE_FILE; 6556c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 6656c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave SparksWAVE_FILE *WaveFileCreate (const char *filename, EAS_I32 nChannels, EAS_I32 nSamplesPerSec, EAS_I32 wBitsPerSample); 6756c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave SparksEAS_I32 WaveFileWrite (WAVE_FILE *wFile, void *buffer, EAS_I32 n); 6856c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave SparksEAS_BOOL WaveFileClose (WAVE_FILE *wFile); 6956c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave SparksWAVE_FILE *WaveFileOpen (const char *filename); 7056c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 7156c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks#endif /* end #ifndef _EAS_WAVE_H */ 7256c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 7356c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 7456c99cd2c2c1e6ab038dac5fced5b92ccf11ff6cDave Sparks 75