public PlaybackState Pause(AudioFile file) { if (file.Stream.DeviceHandle.PlaybackState != PlaybackState.Paused) { file.Stream.DeviceHandle.Pause(); } return file.Stream.DeviceHandle.PlaybackState; }
public PlaybackState Play(AudioFile file) { if (file.Stream.DeviceHandle.PlaybackState != PlaybackState.Playing) { file.Stream.DeviceHandle.Play(); } return file.Stream.DeviceHandle.PlaybackState; }
public AudioFile LoadSound(String location) { AudioFile file = new AudioFile(); file.Load(location); m_Logger.Info("Successfully loaded AudioFile - {0} into player.", location); return file; }
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; }