Exemplo n.º 1
0
        public Audio(SoundOutMode mode)
        {
            Channel1     = new QuadChannel();
            Channel2     = new QuadChannel();
            Channel3     = new WaveChannel();
            Channel4     = new NoiseChannel();
            SampleRate   = 44100;
            BufferSize   = 1024;
            Enabled      = true;
            ticks        = 0;
            samples      = 0;
            samplebuffer = new List <float>();

            switch (mode)
            {
            default:
            case SoundOutMode.OpenAL:
                soundout = new ALSoundOut(this);
                break;

            case SoundOutMode.NAudio:
                soundout = new NAudioSoundOut(this);
                break;
            }
        }
Exemplo n.º 2
0
 public void Start()
 {
     if (Audios.Count >= 1)
     {
         PutMusicToPlayerWithAudioIndex();
         Console.WriteLine("instartmethod");
         SoundOut.Play();
     }
 }
Exemplo n.º 3
0
        public void Play()
        {
            if (SoundOut == null)
            {
                return;
            }

            SoundOut.Volume = Volume;
            SoundOut.Play();

            FileReader.Position = 0;
        }