/////////////////////////////////////////////////////////////////////////////// // // $Id: example2.cc 664 2011-06-16 04:39:00Z weegreenblobbie $ // /////////////////////////////////////////////////////////////////////////////// // Include the Nsound headers #include #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"; // Play it through the sound card AudioPlayback pb(sr, 2, 16); as >> pb; return 0; }