rtsetparams

Set sampling rate, output channels, etc.


Synopsis

rtsetparams(sampling_rate, num_channels [, buffer_size ])


Description

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.


Arguments


NOTES

To have an audio device that handles input and output at the same, you must turn on the record option before calling rtsetparams. Do this with set_option (by saying set_option(“record = 1”)).

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”)).


Examples

   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("record=TRUE")
   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.


See Also

rtinput, rtoutput, set_option