| EST_Wave ()
default constructor
|
| EST_Wave (const EST_Wave &a)
copy constructor
|
| EST_Wave (int samps, int chans, short* memory, int offset=0, int sample_rate=default_sample_rate, int free_when_destroyed=0)
Construct from memory supplied by caller
|
| Access functions for finding ampltiudes of samples
short& | a (int i, int channel = 0)
return amplitude of sample <tt>i</tt> from channel <tt> channel</tt>.
|
short | operator() (int i, int channel) const
return amplitude of sample <tt>i</tt> from channel <tt> channel</tt>.
|
short | operator() (int i) const
return amplitude of sample <tt>i</tt> from channel 0.
|
short& | a_safe (int i, int channel = 0)
Version of a() that returns zero if index is out of array bounds.
|
float | t (int i) const
return the time position in seconds of the ith sample
|
|
| Information functions
int | num_samples () const
return the number of samples in the waveform
|
int | num_channels () const
return the number of channels in the waveform
|
int | sample_rate () const
return the sampling rate (frequency)
|
void | set_sample_rate (const int n)
Set sampling rate to <tt>n</tt>
|
int | length () const
return the size of the waveform, ie.
|
float | end ()
return the time position of the last sample
|
bool | have_left_context (unsigned int n) const
Can we look N samples to the left?
|
EST_String | sample_type () const
returns the file format of the file from which the waveform was read.
|
EST_String | name () const
A string indentifying the waveform, commonly used to store the filename
|
void | set_name (const EST_String n)
Sets name
|
|
| Waveform manipulation functions
void | resize (int num_samples, int num_channels = EST_ALL, int set=1)
resize the waveform
|
void | resample (int rate)
Resample waveform to <tt>rate</tt>
|
void | rescale (float gain, int normalize=0)
multiply all samples by a factor <tt>gain</tt>.
|
void | clear ()
clear waveform and set size to 0
|
|
| File i/o functions
EST_read_status | load (const EST_String filename, int offset=0, int length = 0, int rate = default_sample_rate)
Load a file into the waveform.
|
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)
Load a file of type <tt>filetype</tt> into the waveform.
|
|
EST_Wave& | operator = (const EST_Wave& w)
Assignment operator
|
EST_Wave& | operator += (const EST_Wave &a)
Add to existing wave in serial.
|
EST_Wave& | operator |= (const EST_Wave &a)
Add wave in parallel, ie.
|
void | integrity () const
|