471,584 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,584 software developers and data experts.

need help with the PlaySound Function

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');

}
Jul 19 '05 #1
1 5255
Ben Bateman wrote:
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
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by bballmitch | last post: by
2 posts views Thread by Joe Thompson | last post: by
10 posts views Thread by Ot | last post: by
9 posts views Thread by Andy | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.