Page 1 of 1

modifying beep to play wav files.

Posted: Wed Aug 17, 2005 3:20 am
by declspec
I couldnt find a good forum for this but i thought i would share. Im not a donater so i dont think i have access to the perfect forum.

3 steps and 8 lines keep you away from using your beep to play wave files.

Step #1)
add #include <mmsystem.h> after #include <windows.h> in MQ2Main.h

Step #2)
add winmm.lib to the project settings link file list

Step #3)
text search out the function "MacroBeep" in your project
change the contents to:

Code: Select all

    bRunNextCommand = TRUE;
    //Beep(0x500,250);
	CHAR szArg[MAX_STRING] = {0};

    GetArg(szArg,szLine,1);
    if (szArg[0] == 0) 
		Beep(0x500,250);
	else
		PlaySound(szArg,0,SND_ASYNC);
USAGE:
normal beeps without line arguments play as beeps. However if you use a line arg file name for a beep that corresponds to a wav file that you have put in your EQ directory then it will play that wave file instead.

For example if you put
"bark.wav" in your eq directory and change your macro to use
/beep bark.wav

then instead of hearing a beep you will hear a bark.

If you prefer you can play the sounds in the everquest "sounds" directory by using something like

/beep sounds/bgb_atk.wav

That plays a funky EQ attack sound.

While not fancy this is fast and easy and provides a way to have lots of different sound feedback. PLEASE NOTE that because of the way macroquest works you must have the wave files in your EVERQUEST directory to play them or a specificable directory under that path similiar to the existing "sounds" folder example. [or you could put them in some totally specified folder i suppose but the overarching point is that the default if no path is specified is in the everquest folder and NOT the macroquest folder]

Maybe there is a better plugin out there but im a little ghetto myself =) so who knows. If theres not this would probably be better as a plugin as it is you have to keep readding it to the macroquest download.

Thought i would share.

Thank you
declspec

Posted: Wed Aug 17, 2005 4:10 am
by JJ
Kudos to you. Nice addition. Thank you.

Posted: Wed Aug 17, 2005 4:46 am
by declspec
I edited in an important change. Changed playsound to:

Code: Select all

PlaySound(szArg,0,SND_ASYNC);
What that does is let the EQ process continue running right away instead of hanging while the sound file plays.


You can actually just play the wav files in the "sounds" directory of your EQ directory using this modification instead of supplying them. I hadnt noticed EQ didnt put them into a storage file.

For example:
/beep sounds/box_dth.wav

plays the box breaking apart sound.

There are 100+ of them ready for your macros

Posted: Wed Aug 17, 2005 5:35 am
by dont_know_at_all
I should put this in and make everyone use nmake, because I'm too lazy to open those horrid IDEs.

Posted: Wed Aug 17, 2005 6:52 am
by Zazoot
uh oh he asked for help in the general forum.......

Move to Snippets...

Posted: Thu Aug 18, 2005 12:19 am
by Magick
This is great.. thanks.. was trying to work something like this out.

Might be best to put it over in snippets though... that way we can find it when we need it later... ;)

Great work.

- M

Posted: Thu Aug 18, 2005 12:26 am
by pasini
Thing is this isn't a macro snippet so it doesn't really belong there.
Decl to get vip status and post there ;)