rtsetparams - set sampling rate, output channels, etc.
rtsetparams(sampling_rate, num_channels [, buffer_size ])
Set the sampling rate, number of output channels, and (optionally) the buffer size for an RTcmix session.
You must call rtsetparams before calls to rtinput, rtoutput, or instruments. You can only call rtsetparams once in a script.
The default buffer_size is 4096 sample frames. At a sampling rate of 44100 kHz, this gives a latency of nearly 0.1 seconds, which is unsuitable for real-time work.
You do not have to call rtsetparams for a script that uses only the older disk-based Cmix instruments. Sampling rate and number of channels for these instruments are determined by the input and output sound files, which must already have been created. (See input, output, and sfcreate.)
To have an audio device that handles input and output at the same, you must turn on full duplex before calling rtsetparams. Do this with set_option (by saying set_option(``full_duplex_on'')).
If you want to write a sound file that has more channels than your audio device permits, turn off the audio device with set_option before calling rtsetparams (by saying set_option(``audio_off'')).
rtsetparams(44100, 2)
sets up the session for 44100 sampling rate and two output channels.
rtsetparams(44100, 4, 128)
sets up the session for 44100 sampling rate, four output channels, and a buffer size of 128 sample frames.
set_option("full_duplex_on") rtsetparams(44100, 2, 64) rtinput("AUDIO")
sets up the session for real-time processing of a signal reaching RTcmix from the audio device. You must turn on full duplex operation to tell the audio device to handle input and output simultaneously.