Exemple #1
0
 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.");
 }
Exemple #2
0
        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.");
            }
        }