Edinburgh Speech Tools  2.1-release
EST_WaveFile.h
Go to the documentation of this file.
1  /************************************************************************/
2  /* */
3  /* Centre for Speech Technology Research */
4  /* University of Edinburgh, UK */
5  /* Copyright (c) 1996,1997 */
6  /* All Rights Reserved. */
7  /* */
8  /* Permission is hereby granted, free of charge, to use and distribute */
9  /* this software and its documentation without restriction, including */
10  /* without limitation the rights to use, copy, modify, merge, publish, */
11  /* distribute, sublicense, and/or sell copies of this work, and to */
12  /* permit persons to whom this work is furnished to do so, subject to */
13  /* the following conditions: */
14  /* 1. The code must retain the above copyright notice, this list of */
15  /* conditions and the following disclaimer. */
16  /* 2. Any modifications must be clearly marked as such. */
17  /* 3. Original authors' names are not deleted. */
18  /* 4. The authors' names are not used to endorse or promote products */
19  /* derived from this software without specific prior written */
20  /* permission. */
21  /* */
22  /* THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK */
23  /* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */
24  /* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */
25  /* SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE */
26  /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */
27  /* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */
28  /* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */
29  /* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */
30  /* THIS SOFTWARE. */
31  /* */
32  /*************************************************************************/
33  /* */
34  /* Author: Richard Caley (rjc@cstr.ed.ac.uk) */
35  /* -------------------------------------------------------------------- */
36  /* Wave file formats known to the speech tools. */
37  /* */
38  /*************************************************************************/
39 
40 #ifndef __EST_WAVEFILE_H__
41 #define __EST_WAVEFILE_H__
42 
43 #include "EST_TNamedEnum.h"
44 #include "EST_String.h"
45 #include "EST_Token.h"
46 #include "EST_rw_status.h"
47 #include "EST_Wave.h"
48 #include "EST_wave_aux.h"
49 
50 typedef enum EST_WaveFileType{
63 
64 class EST_WaveFile {
65 public:
66 
67  // We have to use #defines for what should be done with just
68  // typedefs because Sun CC thinks you shouldn't be allowed to
69  // declare a member function via a typedef.
70 
71 #define LoadWaveFileArgs const EST_String filename, \
72  EST_Wave &wv, \
73  int rate, EST_sample_type_t stype, \
74  int bo, int nc, \
75  int offset, int length
76 
77 #define SaveWaveFileArgs const EST_String filename, \
78  const EST_Wave &wv, \
79  EST_sample_type_t stype, int bo
80 
81 #define LoadWave_TokenStreamArgs EST_TokenStream &ts, \
82  EST_Wave &wv, \
83  int rate, EST_sample_type_t stype, \
84  int bo, int nc, \
85  int offset, int length
86 
87 #define SaveWave_TokenStreamArgs FILE *fp, \
88  const EST_Wave &wv, \
89  EST_sample_type_t stype, int bo
90 
92 
94 
95  typedef struct Info {
96  bool recognise;
101  const char *description;
102  } Info;
103 
108 
113 
118 
123 
128 
133 
138 
143 
148 
153 
155 
156  static EST_String options_supported(void);
157  static EST_String options_short(void);
158 };
159 
160 #endif
static EST_write_status save_raw_header(SaveWave_TokenStreamArgs)
static EST_write_status save_nist_data(SaveWave_TokenStreamArgs)
static EST_write_status save_snd(SaveWave_TokenStreamArgs)
static EST_read_status load_riff(LoadWave_TokenStreamArgs)
static EST_write_status save_raw_data(SaveWave_TokenStreamArgs)
static EST_write_status save_alaw_data(SaveWave_TokenStreamArgs)
static EST_read_status load_ulaw(LoadWave_TokenStreamArgs)
EST_write_status
static EST_write_status save_alaw(SaveWave_TokenStreamArgs)
static EST_String options_supported(void)
static EST_write_status save_ulaw_data(SaveWave_TokenStreamArgs)
static EST_write_status save_esps(SaveWave_TokenStreamArgs)
bool save(Lattice &lattice, EST_String filename)
static EST_write_status save_snd_header(SaveWave_TokenStreamArgs)
static EST_write_status save_audlab_header(SaveWave_TokenStreamArgs)
static EST_write_status save_riff_header(SaveWave_TokenStreamArgs)
static EST_write_status save_aiff(SaveWave_TokenStreamArgs)
bool load(Lattice &lattice, EST_String filename)
static EST_write_status save_riff(SaveWave_TokenStreamArgs)
EST_read_status Load_TokenStream(LoadWave_TokenStreamArgs)
Definition: EST_WaveFile.h:91
static EST_read_status load_audlab(LoadWave_TokenStreamArgs)
static EST_read_status load_esps(LoadWave_TokenStreamArgs)
static EST_write_status save_audlab(SaveWave_TokenStreamArgs)
static EST_write_status save_nist(SaveWave_TokenStreamArgs)
static EST_write_status save_est_data(SaveWave_TokenStreamArgs)
static EST_write_status save_est_header(SaveWave_TokenStreamArgs)
static EST_write_status save_aiff_header(SaveWave_TokenStreamArgs)
static EST_write_status save_esps_data(SaveWave_TokenStreamArgs)
static EST_read_status load_raw(LoadWave_TokenStreamArgs)
static EST_write_status save_audlab_data(SaveWave_TokenStreamArgs)
static EST_write_status save_ulaw(SaveWave_TokenStreamArgs)
EST_write_status Save_TokenStream(SaveWave_TokenStreamArgs)
Definition: EST_WaveFile.h:93
Save_TokenStream * save_data
Definition: EST_WaveFile.h:100
static EST_write_status save_aiff_data(SaveWave_TokenStreamArgs)
static EST_write_status save_alaw_header(SaveWave_TokenStreamArgs)
#define SaveWave_TokenStreamArgs
Definition: EST_WaveFile.h:87
static EST_write_status save_riff_data(SaveWave_TokenStreamArgs)
static EST_read_status load_est(LoadWave_TokenStreamArgs)
static EST_read_status load_alaw(LoadWave_TokenStreamArgs)
static EST_String options_short(void)
EST_read_status
static EST_write_status save_ulaw_header(SaveWave_TokenStreamArgs)
static EST_write_status save_raw(SaveWave_TokenStreamArgs)
static EST_read_status load_aiff(LoadWave_TokenStreamArgs)
#define LoadWave_TokenStreamArgs
Definition: EST_WaveFile.h:81
static EST_write_status save_snd_data(SaveWave_TokenStreamArgs)
EST_WaveFileType
Definition: EST_WaveFile.h:50
static EST_write_status save_nist_header(SaveWave_TokenStreamArgs)
static EST_write_status save_esps_header(SaveWave_TokenStreamArgs)
static EST_read_status load_nist(LoadWave_TokenStreamArgs)
static EST_read_status load_snd(LoadWave_TokenStreamArgs)
Save_TokenStream * save_header
Definition: EST_WaveFile.h:99
static EST_write_status save_est(SaveWave_TokenStreamArgs)
static EST_TNamedEnumI< EST_WaveFileType, Info > map
Definition: EST_WaveFile.h:154