Playing MP3 files!

  • Thread starter Thread starter Lee
  • Start date Start date
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
 
Hi,

Maybe you need to call Stop before start playing a new file.
 
o yes, silly me ;-)

However how can I tell when an mp3 or wav file has finished playing?

thanks
 
no idea,

I have never used the objects you are using, but check for some event or
flag
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top