コード例 #1
0
 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.");
 }
コード例 #2
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.");
 }
コード例 #3
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.");
            }
        }