#include <Nsound/NsoundAll.h>
#include <iostream>
Go to the source code of this file.
Definition at line 18 of file example1.cc.
References Nsound::Generator::drawLine(), Nsound::Generator::generate(), Nsound::Buffer::normalize(), sr, and Nsound::Exception::what().
30 Buffer f1 = sine.drawLine(h_time, 345, 923)
31 << sine.drawLine(h_time, 923, 345);
33 Buffer pac_man = sine.generate(7*time, f1);
37 Buffer envelope = sine.drawLine(7*time-0.005, 1.0, 1.0)
38 << sine.drawLine(0.005, 1.0, 0.0);
45 pac_man >>
"example1.wav";
56 cerr <<
"Could not play audio: " << e.
what() << endl;
const char * what() const
void normalize()
Multiplies the Buffer by a constant gain so the peak sample has magnitude 1.0.
A Buffer for storing audio samples.