Advertisement
OKIEWARDOYO

C#.NET No.25-3

Mar 8th, 2013
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. if (windowDialog.FileName.EndsWith(".mp3"))
  2. {
  3.     NAudio.Wave.WaveStream pcm = NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(new NAudio.Wave.Mp3FileReader(windowDialog.FileName));
  4.     stream = new NAudio.Wave.BlockAlignReductionStream(pcm);
  5. }
  6. else if (windowDialog.FileName.EndsWith(".wav"))
  7. {
  8.     NAudio.Wave.WaveStream pcm = new NAudio.Wave.WaveChannel32(new NAudio.Wave.WaveFileReader(windowDialog.FileName));
  9.     stream = new NAudio.Wave.BlockAlignReductionStream(pcm);
  10. }
  11. else throw new InvalidOperationException("Not supported file");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement