rtoutput - open a new sound file for writing
rtoutput(file_name [, header_type ] [, data_format ])
Call rtoutput to open a new sound file for subsequent writing by real-time instruments.
After rtoutput creates a sound file, it prints information about the file, such as the header type and sampling rate.
The older disk-based Cmix instruments use output to open files for writing, not rtoutput.
AIFF is the default if no header type is given.
NOTE: The sampling rate and number of channels are specified in a call to rtsetparams at the beginning of the script.
``short'' is the default if no data format is given.
If you don't want RTcmix to play while you're writing a file, use set_option to turn off playing before you invoke any instruments, by saying set_option(``audio_off'').
The case of the header_type and data_format arguments is not significant, nor is their order.
All formats are big-endian, except for ``wav,'' which is always little-endian, and ``raw,'' which has host byte order.
If you ask for ``aiff'' and ``float'' (or ``normfloat''), you'll get ``aifc'' format instead, because AIFF doesn't support floating-point files.
If you want to use floating-point files in the Snd, choose ``normfloat'' format. If you want to use them in Mxv, choose the ``next'' header type. Many programs don't read AIFC files, maybe because they assume these are always compressed.
rtsetparams(22050, 2) rtoutput("mysound")
writes a stereo, 16-bit linear AIFF file with 22050 sampling rate.
rtsetparams(44100, 1) set_option("audio_off", "clobber_on") rtoutput("myothersound", "wav", "float")
writes a mono, 32-bit floating-point WAV file with 44100 sampling rate. RTcmix will write over any existing file with the same name, and will not play audio while writing.
rtsetparams, set_option, rtinput, output