Solved

HELP - audio in win32 c++ console app

Posted on 2001-09-05
2
408 Views
Last Modified: 2008-01-09
ok, i have already refered to all the comment about using playsound() espcially this article
http://www.experts-exchange.com/jsp/qShow.jsp?qid=20066222

this is my code:

#include <MMSYSTEM.H>
#include <windows.h>


void main()
{
  PlaySound("chimes.wav",NULL,SND_FILENAME|SND_LOOP|SND_ASYNC);
}




the above code is not functionning!
Here are the errors:
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : error C2146: syntax error : missing ';' before identifier 'MMVERSION'

c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : fatal error C1004: unexpected end of file found

**i have already added the "winmm.lib" into project/settings -> link -> object/library modules
, but there is no diffrent


can somebody help me out, and pls tell me what type of wav
file that can play(i mean kHz, bit, stereo/mono, wavelength)


Thanks
0
Comment
Question by:Knight_G
2 Comments
 
LVL 2

Accepted Solution

by:
smitty1276 earned 100 total points
ID: 6459656
Have you tried including windows.h FIRST?  I would assume MMSYSTEM.H needs all of the Windows data types, etc., to be defined before hand... especially considering that this line is the one that generated your error:

typedef UINT MMVERSION;

UINT is a Microsoft thing.
0
 

Author Comment

by:Knight_G
ID: 6459794
wow, it really works!!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question