need help with the PlaySound Function

B

Ben Bateman

I am tyring to write a small menu program that will display the lyrics of a
song, and then play the song. I was told that you have to convert the mp3
to wav, did that.

The 2 function calls under each case is included in another header file that
I created. I have the <mmsystem.h> included in the main cpp file. The
functions under the PlaySound function works correctly, but it is not
playing the wav file.


void main()
{
char choice;

do
{
choice = showMenu(28,10);
switch(choice)
{
case '1': PlaySound("c:\01-thir13teen-pms", NULL, SND_FILENAME |
SND_ASYNC);
typeoNegative();
setcolor(0x0017);
break;
case '2': ozzyshot();
setcolor(0x0021);
break;
case '3': pinkfloyd();
setcolor(0x00e0);
break;
case '4': blackSabbath();
setcolor(0x047);
break;
}
}while(choice != '0');

}
 
K

Kevin Goodsell

Ben said:
I am tyring to write a small menu program that will display the lyrics of a
song, and then play the song. I was told that you have to convert the mp3
to wav, did that.

C++ does not have facilities for playing songs, nor does it have
anything to say about mp3 or wav.
The 2 function calls under each case is included in another header file that
I created. I have the <mmsystem.h>

Not a standard C++ header.
included in the main cpp file. The
functions under the PlaySound function works correctly, but it is not
playing the wav file.

PlaySound is not a standard C++ function.
void main()

In C++, main returns int.

<snip remaining non-standard code>

I don't see a C++ question in your message. If you have a question about
C++, please ask it. If you want to post code demonstrating a problem, we
encourage that, but please leave out any and all non-standard functions,
constructs, etc.

If you *don't* have a C++ question, then please find a more appropriate
newsgroup.

Also, please read the Welcome message which is posted at least twice a
week (I believe it was posted today) with the text "Welcome to
comp.lang.c++. Read this before posting" in the subject line.

-Kevin
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top