Here is an example of the filenchnls opcode. It uses the files filenchnls.orc, filenchnls.sco, and mary.wav.
Example 125. 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 */
The audio file “mary.wav” is monoaural (1 channel). So filenchnls's output should include a line like this:
instr 1: ichnls = 1.000