35 using namespace Nsound;
43 int main(
int argc,
char ** argv)
299 <<
Buffer(
"../examples/walle.wav");
301 input >>
"input.wav";
310 data >>
"data_1.013.wav";
312 Buffer gold(
"gold_1.013.wav");
314 Buffer diff = gold - data;
316 cout <<
"len(orig) = " << input.
getLength() << endl
317 <<
"len(data) = " << data.getLength() << endl
318 <<
"len(gold) = " << gold.
getLength() << endl
320 (
static_cast<float64>(data.getLength())
321 / static_cast<float64>(input.
getLength())) << endl
325 diff.
plot(
"gold - data");
static void show()
Acutally draw the plots to the screen.
void plot(const std::string &title="Buffer") const
Requires matplotlib. Creates a plot of this Buffer.
void resample(float64 factor)
Resamples this Buffer using discrete-time resampling.
Buffer getAbs() const
Modifies a copy of the Buffer by making any negative value positive.
uint32 getLength() const
Returns the number of samples in the Buffer.
int main(int argc, char **argv)
static void setIEEEFloat(boolean flag)
A Buffer for storing audio samples.
static void setDefaultSampleRate(const int32 rate)
static void setDefaultSampleSize(uint32 size)
float64 getMax() const
Returns the maximum sample value in the Buffer.