modifying beep to play wav files.

A forum for the general posts relating to MacroQuest. *DEPRECATED: This forum is no longer in public use, but remains here for your reading pleasure. Enjoy

Moderator: MacroQuest Developers

declspec
decaying skeleton
decaying skeleton
Posts: 3
Joined: Wed Aug 17, 2005 3:12 am

modifying beep to play wav files.

Post by declspec » Wed Aug 17, 2005 3:20 am

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
Last edited by declspec on Wed Aug 17, 2005 5:00 am, edited 4 times in total.

JJ
a hill giant
a hill giant
Posts: 227
Joined: Thu Nov 11, 2004 5:50 am

Post by JJ » Wed Aug 17, 2005 4:10 am

Kudos to you. Nice addition. Thank you.

declspec
decaying skeleton
decaying skeleton
Posts: 3
Joined: Wed Aug 17, 2005 3:12 am

Post by declspec » Wed Aug 17, 2005 4:46 am

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

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Wed Aug 17, 2005 5:35 am

I should put this in and make everyone use nmake, because I'm too lazy to open those horrid IDEs.
--
<Thedude> I have to say your there retarded one.

Zazoot
a hill giant
a hill giant
Posts: 163
Joined: Sat Feb 07, 2004 11:02 am

Post by Zazoot » Wed Aug 17, 2005 6:52 am

uh oh he asked for help in the general forum.......

Magick
decaying skeleton
decaying skeleton
Posts: 1
Joined: Fri Aug 05, 2005 2:14 pm

Move to Snippets...

Post by Magick » Thu Aug 18, 2005 12:19 am

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

pasini
a ghoul
a ghoul
Posts: 97
Joined: Thu Jun 09, 2005 3:19 pm

Post by pasini » Thu Aug 18, 2005 12:26 am

Thing is this isn't a macro snippet so it doesn't really belong there.
Decl to get vip status and post there ;)