|
change
Add Reader.Dispose :: otherwise play the same song ;-)
private bool TryOpenInputFile(string file)
{
bool isValid = false;
try
{
// Add
if (reader != null)
{
reader.Dispose();
reader = null;
}
// change to reader2
using (var reader2 = new MediaFoundationReader(file))
{
DefaultDecompressionFormat = reader2.WaveFormat.ToString();
inputFile = file;
isValid = true;
}
}
catch (Exception e)
{
MessageBox.Show(String.Format("Not a supported input file ({0})", e.Message));
}
return isValid;
}
|