public AudioPCMConfig(int bitsPerSample, int channelCount, int sampleRate, SpeakerConfig channelMask = SpeakerConfig.DIRECTOUT) { _bitsPerSample = bitsPerSample; _channelCount = channelCount; _sampleRate = sampleRate; _channelMask = channelMask == 0 ? GetDefaultChannelMask(channelCount) : channelMask; }
public static int ChannelsInMask(SpeakerConfig mask) { int count = 0; while (mask != 0) { count++; mask &= (mask - 1); } return(count); }