D3D9 Hack - Playing Wav Sound [Solved]

Posts 1–14 of 14 · Page 1 of 1
D3D9 Hack - Playing Wav Sound [Solved]
I just want to make when i enable a hack a .wav tone sound i mean when i enable ex.superjump then make a sound like a ding...thanks for reading
First, add this at the top of the source file:

[highlight=c++]#pragma comment( lib, "Winmm.lib" )[/highlight]

After that, include this header file:

[highlight=c++]#include <Windows.h>[/highlight]

Finally, when you want to play the sound; add this line at that place:

[highlight=c++]PlaySound((LPCTSTR)L"C:\\Windows\\Media\\chimes.wa v",nullptr,SND_SYNC);[/highlight]

PlaySound function resides in the windows.h header file that plays the specified wav sound. We included #pragma comment( lib, "Winmm.lib" ) at the top of the source because we had to instruct the linker to add this additional dependency. #pragma comment is used to specify linker options.

Hope this clarifies and solves your question.
Quote Originally Posted by Hassan View Post
First, add this at the top of the source file:

[highlight=c++]#pragma comment( lib, "Winmm.lib" )[/highlight]

After that, include this header file:

[highlight=c++]#include <Windows.h>[/highlight]

Finally, when you want to play the sound; add this line at that place:

[highlight=c++]PlaySound((LPCTSTR)L"C:\\Windows\\Media\\chimes.wa v",nullptr,SND_SYNC);[/highlight]

PlaySound function resides in the windows.h header file that plays the specified wav sound. We included #pragma comment( lib, "Winmm.lib" ) at the top of the source because we had to instruct the linker to add this additional dependency. #pragma comment is used to specify linker options.

Hope this clarifies and solves your question.
thanks for your replay but i got this error
error C2065: 'nullptr' : undeclared identifier
edit:i fix it but this will playing all the time how can i do it play one time and then stop?
Quote Originally Posted by Mike Shinoda View Post
thanks for your replay but i got this error
error C2065: 'nullptr' : undeclared identifier
edit:i fix it but this will playing all the time how can i do it play one time and then stop?

Put the surrounding code. I mean where have you put this code. Post some code and I might be able to help you. For me, it only plays once.
i do that for my panic key just for testing it
@Hassan

void beep()
{
if(CH_PanicKey)
{
PlaySound((LPCTSTR)L"C:\\Windows\\Media\\chimes.wa v",0,SND_SYNC);

}
}
so when i enable my panickey in menu it will make the sound but they sound its keep playing..and also its only beeping not doing the chimes sound...
Quote Originally Posted by Mike Shinoda View Post
i do that for my panic key just for testing it
@Hassan


so when i enable my panickey in menu it will make the sound but they sound its keep playing..and also its only beeping not doing the chimes sound...
Hmm, seems like the code is doing an infinite loop. I still need to look into CH_Panic before I can tell you with all certainty that the code is running under an infinite loop.

@Mike Shinoda
Quote Originally Posted by Hassan View Post


Hmm, seems like the code is doing an infinite loop. I still need to look into CH_Panic before I can tell you with all certainty that the code is running under an infinite loop.

@Mike Shinoda
do you have any time to help me via teamviewer or something?
@Hassan
Quote Originally Posted by Hassan View Post


Hmm, seems like the code is doing an infinite loop. I still need to look into CH_Panic before I can tell you with all certainty that the code is running under an infinite loop.

@Mike Shinoda
the CH_ would serve somewhat as a hotkey.
Quote Originally Posted by Terell. View Post
the CH_ would serve somewhat as a hotkey.
so do you know how to do it or where to search on web to find a tutorial?
@Mike Shinoda
Use
Code:
void beep()
{
if(CH_PanicKey)
{
PlaySound((LPCTSTR)L"C:\\Windows\\Media\\chimes.wa v",0,SND_SYNC);

}
}
And then put VK_RIGHT or whatever hotkey your using.

@Hassan delete my post above please.
Quote Originally Posted by Terell. View Post
@makis5
Use
Code:
void beep()
{
if(CH_PanicKey)
{
PlaySound((LPCTSTR)L"C:\\Windows\\Media\\chimes.wa v",0,SND_SYNC);

}
}
And then put VK_RIGHT or whatever hotkey your using.

Hassan delete my post above please.
Done. He is already doing exactly what you said. So, I doubt that might be of any help. @Terell.
He's doing a d3dmenu, VK_RIGHT might just trigger the hotkey.
Thank you boys both of you help me much now its working
Cool and NP.
/Marked Solved.
Posts 1–14 of 14 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us