Ejemplo n.º 1
0
 public PlaybackState Pause(AudioFile file)
 {
     if (file.Stream.DeviceHandle.PlaybackState != PlaybackState.Paused)
     {
         file.Stream.DeviceHandle.Pause();
     }
     return file.Stream.DeviceHandle.PlaybackState;
 }
Ejemplo n.º 2
0
 public PlaybackState Play(AudioFile file)
 {
     if (file.Stream.DeviceHandle.PlaybackState != PlaybackState.Playing)
     {
         file.Stream.DeviceHandle.Play();
     }
     return file.Stream.DeviceHandle.PlaybackState;
 }
Ejemplo 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;
        }
Ejemplo 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;
 }