Sign in to follow this  
da_grat1

I cannot run the source code for lesson 21

Recommended Posts

da_grat1    122
what should i do to run the source code for lesson 21.. I used visual C++ to compile the code.. but they are two errors come out. Lesson21.obj : error LNK2001: unresolved external symbol __imp__timeGetTime@0 Lesson21.obj : error LNK2001: unresolved external symbol __imp__PlaySoundA@12 I already added the "glu32.lib opengl32.lib glaux.lib" in the project-->setting-->LInk... but i still cannot run the source code.. Can anyone help me.. thanks

Share this post


Link to post
Share on other sites
clapton    234
Quote:
Original post by da_grat1
thanks a lot


You're welcome. :)

quote]
where did you get the information about winmm.lib... i also want to know...[/quote]

If you write for Windows, MSDN is the best place you can search for answers.

See ya'

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I know this doesn't concern your post, but tutorials #21 is the place where sound is used. It does work in my games, but is there a flag I can set in PlaySound() so that more than one sound can play at a time?
Thanks for this great forum

Share this post


Link to post
Share on other sites
nife    235
No, for that you'll have to use a different API like SDL, OpenAL or DirectSound... (I prefer OpenAL since it's kinda like OpenGL)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Thanks alot, for the help, I guess it won't be too hard to learn OpenAL.

Share this post


Link to post
Share on other sites
kburkhart84    3187
OpenAL I believe to be easier than DirectSound, plus it is like OpenGL. You can use 2d or 3d sound effects which are quite easy to create. Sounds are positioned kind of like translating an object in OpenGL, a simple one-liner. The listener position is the same way, and velocities can also be programmed the same way. Windows API for multimedia kind of blows for games, but works well for simpler apps, in other words, use OpenAL.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Quote:
Original post by nife
No, for that you'll have to use a different API like SDL, OpenAL or DirectSound... (I prefer OpenAL since it's kinda like OpenGL)


Actually, there's a trick that you can use to play multiple sounds with that function... Just spawn a thread that calls PlaySound for every aditional sound. It's a cheap hack, but should work (I haven't tested).

Example:

PlaySound(blabla1);
PlaySound(blabla2);

That will only play the second because it intrrupts the first

Instead have something like this:

int tPlaySound(char *filename)
{
PlaySound(filename);
return 0;
}

CreateThread(..., (void *)tPlaySound, (char *)"blabla1", ...);
CreateThread(..., (void *)tPlaySound, (char *)"blabla2", ...);


that'll play both, or at least should.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this