/////////////////////////////////////////////////////////////////////////////// // // $Id: example2.cc 329 2009-03-18 04:32:18Z weegreenblobbie $ // /////////////////////////////////////////////////////////////////////////////// // Include the Nsound headers #include using namespace Nsound; int main(void) { float64 sr = 44100.0; // Create a new instance of the Sine Generator Sine sine(sr); Buffer pan; pan << sine.generate(1.0, 3.0); // Create a stereo AudioStream. AudioStream as(sr, 2); // Fill it with a 220 Hz sine wave. as << 0.5 * sine.generate(4.9, 220); // Execute the pan method. as.pan(pan); // Write the AudioStream to a wave file as >> "example2.wav"; return 0; }