473,238 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,238 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 5438
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: bballmitch | last post by:
Why won't the following code work? char soundfile2 = "C:/Windows/Media/pinky and the brain.wav"; PlaySound(soundfile2,NULL,SND_FILENAME|SND_SYNC|SND_ASYNC); getchar(); i put libwinmm.a in...
2
by: Joe Thompson | last post by:
Hi, I am trying to use PlaySound in a VC++.net Windows app (VS 2003). I can use it to play a file but now I want to play it from a resource. I have two questions: How do I add a wav file to...
10
by: Ot | last post by:
I found information on PlaySound. I implemented it in my program and it works just dandy. The only little problem is that I have to package the ..wav files and send them along since PlaySound...
9
by: Andy | last post by:
Hi, I have an application that has several forms. Each form acts as a monitor of a gateway system. If the gateway appears to be dead, the application should play a .wav file (not resource)...
1
by: chris962 | last post by:
I have very basic knowledge of Javascript and am trying to get a web page to play one of two different sound files based on whether the user has correctly guessed a number. At the moment, all I...
3
by: Jared | last post by:
I'm using the first code sample below to play WAV files stored as embedded resources. For some reason I *occasionally* get scratching and crackling. I'm using a couple WAVs that ship with...
0
by: Chia Lee Lee | last post by:
Hi... I have a problem when i try to insert a sound file (.wav) to my project but system prompt me an error message as follow: “An unhandled exception of type 'System.NullReferenceException'...
0
by: Mike | last post by:
I am a novice writing a simple program in Visual C++ Express and am having an issue. I basically have several picture boxes of the same size on top of each other with only one visible at a time. ...
7
by: Humakt | last post by:
This is 2D game where there are breakable boxes in the middle two bats on both sides and one or more balls breaking the boxes. Kind of like a mixup of pong and breakout. Collision detection...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.