• Main Page
  • Related Pages
  • Data Structures
  • Files
  • File List
  • Globals

src/sphinx_fe/wave2feat.h

00001 /* ====================================================================
00002  * Copyright (c) 1996-2000 Carnegie Mellon University.  All rights 
00003  * reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * 1. Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer. 
00011  *
00012  * 2. Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in
00014  *    the documentation and/or other materials provided with the
00015  *    distribution.
00016  *
00017  * This work was supported in part by funding from the Defense Advanced 
00018  * Research Projects Agency and the National Science Foundation of the 
00019  * United States of America, and the CMU Sphinx Speech Consortium.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 
00022  * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
00023  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00024  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
00025  * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00026  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
00027  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
00028  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
00029  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
00030  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
00031  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00032  *
00033  * ====================================================================
00034  *
00035  */
00036 
00037 #ifndef _WAVE2FEAT_H_
00038 #define _WAVE2FEAT_H_
00039 
00040 #define NULL_CHAR '\0'
00041 #define MAXCHARS 2048
00042 
00043 /* Huh? */
00044 #define ONE_CHAN "1"
00045 
00046 /* Enums for wavefile types. */
00047 enum {
00048     WAV = 1,
00049     RAW = 2,
00050     NIST = 3,
00051     MSWAV = 4
00052 };
00053 
00054 /* Enums for input endianness. */
00055 enum {
00056     LITTLE =  1,
00057     BIG =  2
00058 };
00059 
00060 /* Enums for conversion operations. */
00061 enum {
00062     WAV2FEAT = 0,
00063     SPEC2CEP = 1,
00064     CEP2SPEC = 2
00065 };
00066 
00067 #define COUNT_PARTIAL 1
00068 #define COUNT_WHOLE 0
00069 #define HEADER_BYTES 1024
00070 
00072 typedef struct RIFFHeader{
00073         char rifftag[4];      /* "RIFF" string */
00074         int32 TotalLength;      /* Total length */
00075         char wavefmttag[8];   /* "WAVEfmt " string (note space after 't') */
00076         int32 RemainingLength;  /* Remaining length */
00077         int16 data_format;    /* data format tag, 1 = PCM */
00078         int16 numchannels;    /* Number of channels in file */
00079         int32 SamplingFreq;     /* Sampling frequency */
00080         int32 BytesPerSec;      /* Average bytes/sec */
00081         int16 BlockAlign;     /* Block align */
00082         int16 BitsPerSample;  /* 8 or 16 bit */
00083         char datatag[4];      /* "data" string */
00084         int32 datalength;       /* Raw data length */
00085 } MSWAV_hdr;
00086 
00087 extern int32 g_nskip, g_runlen;
00088 
00089 #endif

Generated on Fri Jan 14 2011 for SphinxBase by  doxygen 1.7.1