rtinput - open a sound file or audio device for reading
rtinput("input_source")
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).
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 OSX users ("coreaudioprobe") in RTcmix/test/coreaudioprobe. For 'full duplex' (i.e. input and output simultaneously) use of RTcmix, OSX users need to create an "aggregate device" using the AudioMIDISetup.app (in /Applications/Utilities) with both in and out capabilities. As an example, this "aggregate device" is selected using set_option as followe:
set_option("record = on", "device = Aggregate Device:0,0") rtsetparams(44100,2) rtinput("AUDIO")Note that the set_option command has to precede the rtsetparams command in the scorefile.
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