L
Lee
Hi,
I am trying to play mp3 files and have created a simple class to that
accepts a file which can be played and then stopped by calling a stop
method, however.... when an mp3 is re-played the previous one is too!!!
what is going wrong here?
class sound
{
private bool playing;
private string fileName;
QuartzTypeLib.FilgraphManager graphManager = new
QuartzTypeLib.FilgraphManager();
QuartzTypeLib.IMediaControl mc;
public sound()
{
playing = false;
}
public void play(string file)
{
playing = true;
fileName = file;
mc = (QuartzTypeLib.IMediaControl)graphManager;
mc.RenderFile(fileName);
mc.Run();
}
public bool isPlaying()
{
return playing;
}
public void stop()
{
mc.Stop();
playing = false;
}
}
thanks in advance
I am trying to play mp3 files and have created a simple class to that
accepts a file which can be played and then stopped by calling a stop
method, however.... when an mp3 is re-played the previous one is too!!!
what is going wrong here?
class sound
{
private bool playing;
private string fileName;
QuartzTypeLib.FilgraphManager graphManager = new
QuartzTypeLib.FilgraphManager();
QuartzTypeLib.IMediaControl mc;
public sound()
{
playing = false;
}
public void play(string file)
{
playing = true;
fileName = file;
mc = (QuartzTypeLib.IMediaControl)graphManager;
mc.RenderFile(fileName);
mc.Run();
}
public bool isPlaying()
{
return playing;
}
public void stop()
{
mc.Stop();
playing = false;
}
}
thanks in advance