/////////////////////////////////////////////////////////////////////////////// // // $Id: example6.cc 269 2008-11-17 03:49:28Z weegreenblobbie $ // /////////////////////////////////////////////////////////////////////////////// // Nsound headers #include using namespace Nsound; /////////////////////////////////////////////////////////////////////////////// int main(void) { float64 sr = 48000.0; Wavefile::setDefaultSampleRate(48000); Wavefile::setDefaultSampleSize(24); Sine sine(sr); Buffer voice; voice << "california.wav" << sine.silence(0.25) << "walle.wav"; float64 voice_length = voice.getLength(); voice_length /= sr; Granulator gen(48000, Granulator::DECAY, 1.5); Buffer input = gen.generate(voice_length, 880.0, 12, 90); Vocoder vocod(sr, 800, 16); Buffer output = vocod.filter(voice, input); output.normalize(); output *= 0.666; output >> "example5.wav"; return 0; }