예제 #1
0
파일: Sound.cs 프로젝트: amulware/yatl
 public SimpleSound(SoundFile sample, double sampleFrequency, double volume, double frequency)
     : base(sampleFrequency, volume, frequency)
 {
     this.source        = sample.GenerateSource();
     this.source.Volume = (float)volume;  // No jitter
     this.source.Pitch  = (float)(frequency / this.sampleFrequency);
 }
예제 #2
0
        public SoundSource Play(float volume, float pitch)
        {
            AudioManager.Instance.EffectsVolume = volume;
            AudioManager.Instance.Pitch         = pitch;
            var src = snd.GenerateSource();

            src.Play();
            return(new SoundSource(src));
        }
예제 #3
0
파일: Sound.cs 프로젝트: amulware/yatl
        public SRSound(SoundFile sustain, SoundFile release, double sampleFrequency, double volume, double frequency)
            : base(sampleFrequency, volume, frequency)
        {
            this.sustain = sustain.GenerateSource();
            this.release = release.GenerateSource();

            foreach (var source in new Source[] { this.sustain, this.release })
            {
                //source.Volume = (float)(volume * 0.4); // Fix jitter
                source.Volume = (float)volume; // No jitter with wav files
                source.Pitch  = (float)(frequency / this.sampleFrequency);
            }
        }