| 1 |
// Listing 4.6 Loading and playing stereo sound files using SndBuf2 |
| 2 |
|
| 3 |
// Loading and playing stereo sound files |
| 4 |
// by ChucK Programmer, September, 2023 |
| 5 |
SndBuf2 myStereoSound => dac; // Makes a stereo SndBuf2 |
| 6 |
// and connects it to the dac |
| 7 |
// (stereo is automatic!). |
| 8 |
|
| 9 |
// load up a stereo file using .read |
| 10 |
me.dir()+"/audio/stereo_fx_01.wav" => myStereoSound.read; |
| 11 |
|
| 12 |
// and let it play for the right amount of time |
| 13 |
myStereoSound.length() => now; // (1) New function/method! |
| 14 |
// .length returns the exact |
| 15 |
// duration of the sound file. |
| 16 |
|
| 17 |
|