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