public void CanPlayMonoToStereoSourceTest() { var source = new StereoToMonoSource(CodecFactory.Instance.GetCodec(testfile)); Assert.AreEqual(1, source.WaveFormat.Channels); var monoSource = new MonoToStereoSource(source); Assert.AreEqual(2, monoSource.WaveFormat.Channels); ISoundOut soundOut; if (WasapiOut.IsSupportedOnCurrentPlatform) soundOut = new WasapiOut(); else soundOut = new DirectSoundOut(); soundOut.Initialize(monoSource.ToWaveSource(16)); soundOut.Play(); Thread.Sleep((int)Math.Min(source.GetMilliseconds(source.Length), 60000)); soundOut.Dispose(); }
public void CanPlayStereoToMonoSource() { //in order to fix workitem 3 var source = GlobalTestConfig.TestMp3().ToStereo(); Assert.AreEqual(2, source.WaveFormat.Channels); var monoSource = new StereoToMonoSource(source.ToSampleSource()); Assert.AreEqual(1, monoSource.WaveFormat.Channels); ISoundOut soundOut; if (WasapiOut.IsSupportedOnCurrentPlatform) soundOut = new WasapiOut(); else soundOut = new DirectSoundOut(); soundOut.Initialize(monoSource.ToWaveSource(16)); soundOut.Play(); Thread.Sleep((int)Math.Min(source.GetMilliseconds(source.Length), 20000)); soundOut.Dispose(); }