コード例 #1
0
        public ReceiverSampleProvider(WaveFormat waveFormat, ushort id, int voiceInputNumber)
        {
            WaveFormat = waveFormat;
            ID         = id;

            mixer = new MixingSampleProvider(WaveFormat)
            {
                ReadFully = true
            };

            voiceInputs = new List <CallsignSampleProvider>();
            for (int i = 0; i < voiceInputNumber; i++)
            {
                var voiceInput = new CallsignSampleProvider(WaveFormat, this);
                voiceInputs.Add(voiceInput);
                mixer.AddMixerInput(voiceInput);
            }
            ;

            blockTone = new BlockingToneSampleProvider(WaveFormat.SampleRate, 1)
            {
                Gain = 0, Frequency = 180
            };
            mixer.AddMixerInput(blockTone.ToMono());
            volume = new VolumeSampleProvider(mixer);
        }
コード例 #2
0
        public ReceiverSampleProvider(WaveFormat waveFormat, ushort id, int voiceInputNumber)
        {
            WaveFormat = waveFormat;
            ID         = id;

            mixer = new MixingSampleProvider(WaveFormat)
            {
                ReadFully = true
            };

            voiceInputs = new List <CallsignSampleProvider>();
            for (int i = 0; i < voiceInputNumber; i++)
            {
                var voiceInput = new CallsignSampleProvider(WaveFormat, this);
                voiceInputs.Add(voiceInput);
                mixer.AddMixerInput(voiceInput);
            }
            ;

            blockTone = new BlockingToneSampleProvider(WaveFormat.SampleRate, 1)
            {
                Frequency = 180, Gain = 0
            };
            hfWhiteNoise = new ResourceSoundSampleProvider(Samples.Instance.HFWhiteNoise)
            {
                Looping = true, Gain = 0
            };

            mixer.AddMixerInput(blockTone.ToMono());
            if (!AudioConfig.Instance.HfSquelch)
            {
                mixer.AddMixerInput(hfWhiteNoise.ToMono());
            }
            volume = new VolumeSampleProvider(mixer);

            hfSquelchEn = AudioConfig.Instance.HfSquelch;
        }