71 void default_vals(
int n=0,
int c=1);
78 static const int default_sample_rate;
79 static const int default_num_channels;
90 short *memory,
int offset=0,
int sample_rate=default_sample_rate,
91 int free_when_destroyed=0);
103 short &
a(
int i,
int channel = 0);
104 short a(
int i,
int channel = 0)
const;
105 INLINE
short &a_no_check(
int i,
int channel = 0)
106 {
return p_values.a_no_check(i,channel); }
107 INLINE
short a_no_check(
int i,
int channel = 0)
const
108 {
return p_values.a_no_check(i,channel); }
109 INLINE
short &a_no_check_1(
int i,
int channel = 0)
110 {
return p_values.a_no_check_1(i,channel); }
111 INLINE
short a_no_check_1(
int i,
int channel = 0)
const
112 {
return p_values.a_no_check_1(i,channel); }
117 INLINE
short set_a(
int i,
int channel = 0,
short val = 0)
118 {
return a(i,channel) = val; }
124 {
return a(i,channel); }
134 short &
a_safe(
int i,
int channel = 0);
137 float t(
int i)
const {
return (
float)i/(float)p_sample_rate; }
157 {
return p_values.have_rows_before(n); }
164 void set_sample_type(
const EST_String t) { f_set(
"sample_type",
t); }
166 EST_String file_type()
const {
return f_String(
"file_type",
"riff"); }
167 void set_file_type(
const EST_String
t) { f_set(
"file_type",
t); }
177 const EST_SMatrix &values()
const {
return p_values; }
178 EST_SMatrix &values() {
return p_values; }
191 void compress(
float mu,
float limit);
197 void rescale(
float gain,
int normalize=0);
210 void fill(
short v=0,
int channel=EST_ALL);
212 void empty(
int channel=EST_ALL) { fill(0,channel); }
214 void sample(EST_TVector<short> &sv,
int n)
215 { p_values.row(sv, n); }
216 void channel(EST_TVector<short> &cv,
int n)
217 { p_values.column(cv, n); }
219 void copy_channel(
int n,
short *buf,
int offset=0,
int num=EST_ALL)
const
220 { p_values.copy_column(n, buf, offset, num); }
221 void copy_sample(
int n,
short *buf,
int offset=0,
int num=EST_ALL)
const
222 { p_values.copy_row(n, buf, offset, num); }
224 void set_channel(
int n,
const short *buf,
int offset=0,
int num=EST_ALL)
225 { p_values.set_column(n, buf, offset, num); }
226 void set_sample(
int n,
const short *buf,
int offset=0,
int num=EST_ALL)
227 { p_values.set_row(n, buf, offset, num); }
231 int offset=0,
int num=EST_ALL,
232 int start_c=0,
int nchan=EST_ALL);
235 int offset=0,
int num=EST_ALL,
236 int start_c=0,
int nchan=EST_ALL)
const
237 { ((
EST_Wave *)
this)->sub_wave(sw, offset, num, start_c, nchan); }
250 EST_read_status
load(
const EST_String filename,
253 int rate = default_sample_rate);
255 EST_read_status
load(EST_TokenStream &ts,
258 int rate = default_sample_rate);
260 EST_read_status
load(
const EST_String filename,
261 const EST_String filetype,
264 int rate = default_sample_rate);
266 EST_read_status
load(EST_TokenStream &ts,
267 const EST_String filetype,
270 int rate = default_sample_rate);
281 EST_read_status
load_file(
const EST_String filename,
284 int offset = 0,
int length = 0);
285 EST_read_status
load_file(EST_TokenStream &ts,
288 int offset = 0,
int length = 0);
293 EST_write_status save(
const EST_String filename,
294 const EST_String EST_filetype =
"");
296 EST_write_status save(FILE *fp,
297 const EST_String EST_filetype =
"");
299 EST_write_status save_file(
const EST_String filename,
301 EST_String
sample_type,
int bo,
const char *mode =
"wb");
303 EST_write_status save_file(FILE *fp,
307 EST_write_status save_file_header(FILE *fp,
309 EST_String stype,
int obo);
310 EST_write_status save_file_data(FILE *fp,
312 EST_String stype,
int obo);
330 void integrity()
const { p_values.integrity() ; }
EST_read_status load_file(const EST_String filename, const EST_String filetype, int sample_rate, const EST_String sample_type, int bo, int nc, int offset=0, int length=0)