• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Results 1 to 8 of 8
    1. #1
      Hacker
      Retired
       
      Pawning
       
      Crazywink's Avatar
      Join Date
      Jul 2012
      Location
      US
      Posts
      647
      Thanks (-->)
      111
      Thanks (<--)
      226

      Playing Sound In D3D Menu

      John Kittz
      Hey guys, I made this quick template so you guys can see how you can play a sound inside your D3D Menu.

      Thanks to Fleep for his D3D Template, I just quickly changed the layout and added in the code for the sound to that project.

      This isn't really a practical D3D Menu for anything, but a simple one so you can see how everything is working.

      Practical use:
      Practical use of this would be to include it with your menu, and every time someone turns an option on/off play the sound.

      Code used to make player:
      The code is super simple. First we start off including the Winmm library
      Code:
      #pragma comment( lib, "Winmm.lib" )
      Then actually playing the song:
      Code:
      if(GetAsyncKeyState(VK_RIGHT))
      	{
      PlaySound("C:\\SoundFile.wav",NULL,SND_SYNC);
      }
      Very simple stuff. You can download the project to see exactly how it's used.


      Quick picture of it since people seem to like that
      Playing Sound In D3D Menu

      crazywink

    2. #2
      Hacker
      Learning to hack games!
       
      Pawning
       
      Fleep's Avatar
      Join Date
      May 2012
      Posts
      626
      Thanks (-->)
      208
      Thanks (<--)
      727

      Re: Playing Sound In D3D Menu

      Thats really straight forward, Ive never considered doing it for a D3D menu but that seems great.

      Fleep

    3. #3
      Hacker
      Retired
       
      Pawning
       
      Crazywink's Avatar
      Join Date
      Jul 2012
      Location
      US
      Posts
      647
      Thanks (-->)
      111
      Thanks (<--)
      226

      Re: Playing Sound In D3D Menu

      [quote author=Fleep link=topic=445.msg2698#msg2698 date=1343826677]
      Thats really straight forward, Ive never considered doing it for a D3D menu but that seems great.

      Fleep
      [/quote]

      Yeah, really simple but adds a nice touch to the menu.

    4. #4
      Kim Kong Trasher
      I don't have status.
       
      Raging
       
      c5's Avatar
      Join Date
      Jul 2012
      Location
      Mankei Iland
      Posts
      1,221
      Thanks (-->)
      97
      Thanks (<--)
      491

      Re: Playing Sound In D3D Menu

      Yeah, it adds the fancy touch to it, really great contribution. Thanks for sharing
      Playing Sound In D3D Menu

    5. #5
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      BlackPitchPL's Avatar
      Join Date
      May 2012
      Location
      POLAND
      Posts
      171
      Thanks (-->)
      1
      Thanks (<--)
      14

      Re: Playing Sound In D3D Menu

      My menu sound :P

      sound.cpp
      Code:
      #include "cSound.h"
      
      #pragma comment(lib, "WinMM.Lib")
      
      void cSound::swav::playsound(LPCSTR sound)
      {
      	sndPlaySound(sound,SND_ASYNC);
      }
      void cSound::swav::playsoundmem(LPCSTR sound)
      {
      	sndPlaySound(sound,SND_ASYNC|SND_MEMORY);
      }
      sound.h
      Code:
      #include "stdafx.h"
      #include &lt;mmsystem.h&gt;
      
      #pragma once
      
      // Stripped Sound Class kinda pointless for public release since i stripped all the cool functions but more pain to remove lol
      
      class cSound
      {
      	
      public:
      
      	struct smp3
      	{
      	
      	}mp3;
      
      	struct swav
      	{
      	void playsound(LPCSTR sound);
      	void playsoundmem(LPCSTR sound);
      	}wav;
      
      };
      extern cSound Sound;
      stdafx :P
      Code:
      #pragma once
      
      #define WIN32_LEAN_AND_MEAN
      #define WIN32_EXTRA_LEAN
      
      #include &lt;windows.h&gt;
      #include &lt;time.h&gt;
      #include &lt;stdio.h&gt;
      #include &lt;stdlib.h&gt;
      #include &lt;d3d8.h&gt;
      #include &lt;d3dx8.h&gt;
      and u need to add some 2 declarers but post are limited to 2000 chars :P

    6. #6
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Helgon's Avatar
      Join Date
      Aug 2012
      Posts
      8
      Thanks (-->)
      0
      Thanks (<--)
      1

      Re: Playing Sound In D3D Menu

      thanks for the snippets, easy but if never done u dont know how

    7. #7
      Newbie
      meh
       
      Innocent
       
      KaizenLouie's Avatar
      Join Date
      Nov 2016
      Posts
      11
      Thanks (-->)
      0
      Thanks (<--)
      2

      Re: Playing Sound In D3D Menu

      I think its a good practice (probably better) to make an example that the resource used will be coming from the project's resource folder/section.

      btw, good idea and can be implemented even on non-d3d stuff.

    8. #8
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      steb's Avatar
      Join Date
      Aug 2016
      Posts
      44
      Thanks (-->)
      1
      Thanks (<--)
      1

      Re: Playing Sound In D3D Menu

      Cheats'n'Trainers
      We can use bytes too right ?

    Similar Game Hacker Threads

    1. [Discuss] Do you enjoy playing League of Legends?
      By [GH]Rake in forum Polls
      Replies: 20
      Last Post: 09-22-2015, 06:17 PM
    2. [Help] Headshot sound play
      By mcdeliver18 in forum Visual Basic
      Replies: 1
      Last Post: 06-04-2014, 11:27 AM
    3. [Off Topic] What Game Are You Currently Playing?
      By Crazywink in forum Off Topic
      Replies: 35
      Last Post: 04-12-2014, 08:17 PM
    4. Replies: 8
      Last Post: 03-08-2013, 05:22 PM