n = GetChannels()
Note that this argument doesn't return the free audio channels but the total audio channels. To check if there is a channel that can be used for audio output, use the HaveFreeChannel() function instead. See HaveFreeChannel for details.
Also note that if the legacy audio driver is active on AmigaOS (it is by default on AmigaOS 3.x for performance reasons) the first four channels will be reserved for Protracker playback. The console argument ‘-nolegacyaudio’ can be used to disable the legacy audio driver on AmigaOS 3.x. See console arguments for details.