Solved

HELP - audio in win32 c++ console app

Posted on 2001-09-05
2
414 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
[X]
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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

734 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