Open a sound file or audio device for reading.
rtinput(“input_source” [, “memory” ])
Parameters inside the [brackets] are optional.
Call rtinput to open a sound file, or an audio device, for subsequent reading by real-time instruments.
(“Audio device” just refers to the hardware that handles sound I/O, such as a sound card on a PC or the built-in hardware on a Mac. Different device types may be specified using the set_option scorefile command.)
After rtinput opens a sound file, it prints information about the file, such as the header type and sampling rate (unless the print_off scorefile command has been issued).
“input_source”
A text string with the name of a sound file, in double-quotes, having a header format that RTcmix understands. (These include, but are not limited to, AIFF, AIFC, WAVE, NeXT, and IRCAM.) Only files with data formats of 32-bit floating point or 16-bit or 24-bit integer are readable. NOTE: MP3 and other compressed formats are not supported at present.
If input_source is “AUDIO”, then input comes from the audio device. This lets you send input to RTcmix from a microphone or line-level source. The mic/line audio device is selected using the set_option scorefile command. For Linux users, there is a utility program called “alsaprobe” in RTcmix/test/alsa that can list the available devices. A similar program exists for macOS users (“coreaudioprobe”) in RTcmix/test/coreaudioprobe. For full duplex (i.e., input and output simultaneously) use of RTcmix, macOS users may need to create an “aggregate device” using the AudioMIDISetup application (in /Applications/Utilities) with both input and output capabilities. As an example, this aggregate device is selected using set_option as follows:
set_option("record = on", "device = Aggregate Device:0,0")
rtsetparams(48000, 2)
rtinput("AUDIO")
Note that the set_option command has to precede the rtsetparams command in the scorefile.
“memory”
This optional argument causes the sound file to be read entirely into RAM at the time of the rtinput call. Without this argument, RTcmix reads the file while an instrument plays.
rtinput("myfile.aif")
Opens “myfile.aif,’’ an AIFF file in the current directory, for reading by any instruments that follow this line in the script.
rtinput("/home/bubba/snd/trouble.wav")
Opens “trouble.wav’’ using a full path name.
rtinput("AUDIO")
Opens the audio device for reading.
bus_config, rtsetparams, rtoutput, set_option, DUR, PEAK, SR, filechans, filedur, filepeak, filesr