Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (windowDialog.FileName.EndsWith(".mp3"))
- {
- NAudio.Wave.WaveStream pcm = NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(new NAudio.Wave.Mp3FileReader(windowDialog.FileName));
- stream = new NAudio.Wave.BlockAlignReductionStream(pcm);
- }
- else if (windowDialog.FileName.EndsWith(".wav"))
- {
- NAudio.Wave.WaveStream pcm = new NAudio.Wave.WaveChannel32(new NAudio.Wave.WaveFileReader(windowDialog.FileName));
- stream = new NAudio.Wave.BlockAlignReductionStream(pcm);
- }
- else throw new InvalidOperationException("Not supported file");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement