Exemple #1
0
 public AudioPCMConfig(int bitsPerSample, int channelCount, int sampleRate, SpeakerConfig channelMask = SpeakerConfig.DIRECTOUT)
 {
     _bitsPerSample = bitsPerSample;
     _channelCount = channelCount;
     _sampleRate = sampleRate;
     _channelMask = channelMask == 0 ? GetDefaultChannelMask(channelCount) : channelMask;
 }
Exemple #2
0
 public AudioPCMConfig(int bitsPerSample, int channelCount, int sampleRate, SpeakerConfig channelMask = SpeakerConfig.DIRECTOUT)
 {
     _bitsPerSample = bitsPerSample;
     _channelCount  = channelCount;
     _sampleRate    = sampleRate;
     _channelMask   = channelMask == 0 ? GetDefaultChannelMask(channelCount) : channelMask;
 }
Exemple #3
0
        public static int ChannelsInMask(SpeakerConfig mask)
        {
            int count = 0;

            while (mask != 0)
            {
                count++;
                mask &= (mask - 1);
            }
            return(count);
        }