Esempio n. 1
0
 public PlaybackState Pause(AudioFile file)
 {
     if (file.Stream.DeviceHandle.PlaybackState != PlaybackState.Paused)
     {
         file.Stream.DeviceHandle.Pause();
     }
     return file.Stream.DeviceHandle.PlaybackState;
 }
Esempio n. 2
0
 public PlaybackState Play(AudioFile file)
 {
     if (file.Stream.DeviceHandle.PlaybackState != PlaybackState.Playing)
     {
         file.Stream.DeviceHandle.Play();
     }
     return file.Stream.DeviceHandle.PlaybackState;
 }
Esempio n. 3
0
        public AudioFile LoadSound(String location)
        {
            AudioFile file = new AudioFile();
            file.Load(location);
            m_Logger.Info("Successfully loaded AudioFile - {0} into player.", location);

            return file;
        }
Esempio n. 4
0
 public PlaybackState Stop(AudioFile file)
 {
     if (file != null && file.Stream.DeviceHandle.PlaybackState != PlaybackState.Stopped)
     {
         file.Stream.DeviceHandle.Stop();
         // Is this not set internally? I am very confused...
         file.Stream.WaveStream.Position = 0;
         m_Logger.Info("Stopping playback of an AudioFile!");
         while (file.Stream.DeviceHandle.PlaybackState != PlaybackState.Stopped)
         {
             file.Stream.DeviceHandle.Stop();
         }
         return file.Stream.DeviceHandle.PlaybackState;
     }
     else
     {
         m_Logger.Warn("Audio Stream was null when attempting to stop!");
     }
     return PlaybackState.Stopped;
 }