bruno386 0 Newbie Poster

Hello!

Im writing a small windows form app in VS2008express which uses the directx audio class to play a selected mp3 when an event triggers, however it will play the mp3 everytime the event triggers, but i only want it to play the mp3 when the current one has finished. I thought i could usea timer in conjunction with the audo.playing property like thisfor example....

(mp3 is the audio class instantiated)

bool mp3check = mp3.playing

if (mp3check == false)
{
     mp3.play()
}
else
{
do nothing
}

I cant seem to get it to work. I did a similar thing once when sending emails using a timer, i just switch on the timer once an email was sent, then the timer can dictate when another email canbe sent by incrementing some value every second, then once a desired seconds (increments passed) emails will once send again.

Anyone got any suggestions?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.