Error in book "Programming for Musicians and digital artists by Ge Wang" ?
Hi, I was looking in your book and copied listing 4.3 " Playing a sound file backward" But it didn't work. Hopefully i did everything correctly. It did perform the first (forward) part but during the reverse part i heard nothing. Can you please help me.... Kind regards, Herman // copy Listing 4.3 Playing a sound file backward // from Programming for Musicians and digital artists by Ge Wang me.sourceDir() + "sample.wav" => string filename; if( me.args() ) me.arg(0) => filename; // the patch SndBuf mySound => dac; // load the file in buf filename => mySound.read; mySound.samples() => int numSamples; 0 => mySound.pos; // this was ok numSamples::samp => now; numSamples => mySound.pos; // This was not heard. Athough the program stayed in VM. -1.0 => mySound.rate; numSamples::samp => now;
participants (1)
-
herman verbaeten