Here is an example of the filenchnls opcode. It uses the files filenchnls.orc, filenchnls.sco, and mary.wav.
Example 15-1. Example of the filenchnls opcode.
/* filenchnls.orc */
; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
; Instrument #1.
instr 1
; Print out the number of channels in the
; audio file "mary.wav".
ichnls filenchnls "mary.wav"
print ichnls
endin
/* filenchnls.orc */
/* filenchnls.sco */
; Play Instrument #1 for 1 second.
i 1 0 1
e
/* filenchnls.sco */
instr 1: ichnls = 1.000