Пример #1
0
        public MainWindow()
        {
            InitializeComponent();

            audioEngine = new AudioPlaybackEngine();

            pianoC  = new CachedSound(SoundNames.PianoC);
            pianoDb = new CachedSound(SoundNames.PianoDb);
            pianoD  = new CachedSound(SoundNames.PianoD);
            pianoEb = new CachedSound(SoundNames.PianoEb);
            pianoE  = new CachedSound(SoundNames.PianoE);
            pianoF  = new CachedSound(SoundNames.PianoF);
            pianoGb = new CachedSound(SoundNames.PianoGb);
            pianoG  = new CachedSound(SoundNames.PianoG);
            pianoAb = new CachedSound(SoundNames.PianoAb);
            pianoA  = new CachedSound(SoundNames.PianoA);
            pianoBb = new CachedSound(SoundNames.PianoBb);
            pianoB  = new CachedSound(SoundNames.PianoB);

            /*playerC = new SoundPlayer(SoundNames.PianoC);
             * playerC.Load();
             * playerDb = new SoundPlayer(SoundNames.PianoDb);
             * playerDb.Load();
             * playerD = new SoundPlayer(SoundNames.PianoD);
             * playerD.Load();
             * playerEb = new SoundPlayer(SoundNames.PianoEb);
             * playerEb.Load();
             * playerE = new SoundPlayer(SoundNames.PianoE);
             * playerE.Load();
             * playerF = new SoundPlayer(SoundNames.PianoF);
             * playerF.Load();
             * playerGb = new SoundPlayer(SoundNames.PianoGb);
             * playerGb.Load();
             * playerG = new SoundPlayer(SoundNames.PianoG);
             * playerG.Load();
             * playerAb = new SoundPlayer(SoundNames.PianoAb);
             * playerAb.Load();
             * playerA = new SoundPlayer(SoundNames.PianoA);
             * playerA.Load();
             * playerBb = new SoundPlayer(SoundNames.PianoBb);
             * playerBb.Load();
             * playerB = new SoundPlayer(SoundNames.PianoB);
             * playerB.Load();*/
        }
Пример #2
0
 public void PlaySound(CachedSound sound)
 {
     AddMixerInput(new CachedSoundSampleProvider(sound));
 }
Пример #3
0
 public CachedSoundSampleProvider(CachedSound cachedSound)
 {
     this.cachedSound = cachedSound;
 }