public static void Save(SoundData soundData, Stream stream, SoundFileFormat format) { if (format == SoundFileFormat.Wav) { Wav.Save(soundData, stream); return; } throw new InvalidOperationException("Unsupported sound file format."); }
public static SoundFileFormat DetermineFileFormat(Stream stream) { if (Wav.IsWavStream(stream)) { return(SoundFileFormat.Wav); } if (Ogg.IsOggStream(stream)) { return(SoundFileFormat.Ogg); } throw new InvalidOperationException("Unsupported sound file format."); }
public static StreamingSource Stream(Stream stream, SoundFileFormat format) { switch (format) { case SoundFileFormat.Wav: return(Wav.Stream(stream)); case SoundFileFormat.Ogg: return(Ogg.Stream(stream)); default: throw new InvalidOperationException("Unsupported sound file format."); } }