You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
2.0KB

  1. /*! \page multichannel Multi-Channel I/O
  2. The ToolKit stk::WvIn and stk::WvOut classes (and their subclasses) support multi-channel audio data input and output. Several other abstract base classes, such as stk::Instrmnt, stk::Generator, and stk::Effect, also support multi-channel computations though not all of their subclasses produce or take multi-channel data. A set of interleaved audio samples representing a single time "slice" is referred to as a <I>sample frame</I>. At a sample rate of 44.1 kHz, a four-channel audio stream will have 44100 sample frames per second and a total of 176400 individual samples per second.
  3. Most STK classes process single-sample data streams via their
  4. <TT>tick()</TT> function. For classes supporting multi-channel data,
  5. one must distinguish the <TT>tick()</TT> functions taking or producing
  6. single \c StkFloat arguments from those taking stk::StkFrames& arguments. If
  7. a single-sample version of the <TT>tick()</TT> function is called for
  8. these classes, a full sample frame is computed but only a single value
  9. is either input and/or output. For example, if the single-sample
  10. <TT>tick()</TT> function is called for subclasses of WvOut, the sample
  11. argument is written to all channels in the one computed frame. For
  12. classes returning values, an optional \c channel argument specifies
  13. which channel value is returned from the computed frame (the default
  14. is always channel 0). To input and/or output multichannel data to
  15. these classes, the overloaded <TT>tick()</TT> functions taking
  16. StkFrames reference arguments should be used.
  17. Multi-channel support for realtime audio input and output is dependent on the audio device(s) available on your system.
  18. The following example demonstrates the use of the stk::FileWvOut class for
  19. creating a four channel, 16-bit AIFF formatted audio file. We will
  20. use four sinewaves of different frequencies for the first two seconds
  21. and then a single sinewave for the last two seconds.
  22. \include foursine.cpp
  23. [<A HREF="tutorial.html">Main tutorial page</A>] &nbsp; [<A HREF="polyvoices.html">Next tutorial</A>]
  24. */