private static int calculateChannels(int chan) {
        return chan < 3 ? 2 : 1;
    }
Calculates the number of channels based on the given parameters.

@param chan the code for the channels
@return the number of channels
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-audiovideo-module/src/main/java/org/apache/tika/parser/mp3/MpegStream.java