Hi all,

I hope that someone can help me, I have been given a task in work to create a simple VB6 countdown program for a school quiz.

The user can enter any given time to countdown to, but when the counter reaches 30 seconds, it opens and plays an MP3 file (countdown music) to let the students know that they have 30 seconds left to answer the question.

I have already created the countdown program, but would like to know how to play the MP3 file at 30 seconds. I can post my code for the countdown program if it will help.

Regards,

Chris

You can use the shell() function to open your mp3 file at 30 seconds.

You can use the shell() function to open your mp3 file at 30 seconds.

Hi,

Thanks 'ryan' for the quick reply.
Could you give me an example of the shell() function.
I've attached a copy of my VB code.

Chris.

A shell function is a function that calls another program to be executed.Like foe example shell(calc.exe),it calls the calculator to be opened.In your case,You can shell like this: shell(*path of your .mp3file).

*Sorry I couldn't open your files,I have no VB installed right now.

I've been reading through the forum and have found references to a 'api playsound' function.

Could anybody help me by giving an example.

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.