Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

HELP - audio in win32 c++ console app

Posted on 2001-09-05
2
403 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

840 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