Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Halo Mumble Plugin(Code)

  1. #1
    Codesaurus Skarma's Avatar
    Join Date
    Apr 2009
    Location
    Columbus, OH
    Posts
    227

    Halo Mumble Plugin(Code)

    By: Prolak aka Snarf
    3d Positional Sound
    http://mumble.sourceforge.net/FAQ#Ho..._sound_work.3F
    "Still working on it if anyone has a good idea on how to scale the distance please post " I think it's because of the game units halo uses, but if anyone else knows, post please!


    Code:
    /*Credits: Skarma,Skillz and whoever wrote this skeleton base*/
     
    #define _USE_MATH_DEFINES
    #include <stdio.h>
    #include <stdlib.h>
    #include <windows.h>
    #include <tlhelp32.h>
    #include <math.h>
    #include "mumble_plugin.h"
    HANDLE h = NULL;
    static DWORD getProcess(const wchar_t *exename) {
     PROCESSENTRY32 pe;
     DWORD pid = 0;
     pe.dwSize = sizeof(pe);
     HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
     if (hSnap != INVALID_HANDLE_VALUE) {
      BOOL ok = Process32First(hSnap, &pe);
      while (ok) {
       if (wcscmp(pe.szExeFile, exename)==0) {
        pid = pe.th32ProcessID;
        break;
       }
       ok = Process32Next(hSnap, &pe);
      }
      CloseHandle(hSnap);
     }
     return pid;
    }
     
     
     
    static bool peekProc(VOID *base, VOID *dest, SIZE_T len) {
     SIZE_T r;
     BOOL ok=ReadProcessMemory(h, base, dest, len, &r);
     return (ok && (r == len));
    }
    static void about(HWND h) {
     ::MessageBox(h, L"Reads audio position information from Halo", L"Mumble Halo Plugin", MB_OK);
    }
     
    static int fetch(float *pos, float *front, float *top) {
     float viewHor, viewVer;
     char state;
     for (int i=0;i<3;i++)
      pos[i]=front[i]=top[i]=0.0f;
     bool ok;
     
     ok = peekProc((BYTE *) 0x06AC4DE, &state, 1);
     if (! ok)
      return false;
     if (state == 3)
      return true; 
     
     
          DWORD addie;
          ok =
          peekProc((BYTE *) (0x6AC4E4) , pos,   4) && 
          peekProc((BYTE *) (0x6AC4E8) , pos+1, 4) && 
          peekProc((BYTE *) (0x6AC4EC) , pos+2, 4) && 
     
     
      peekProc((BYTE *) (0x6AC504) , front,   4) && 
      peekProc((BYTE *) (0x6AC508) , front+1, 4) &&
      peekProc((BYTE *) (0x6AC50C) , front+2, 4);
     
     
     
     
     
      if (! ok)
      return false;
     
        return ok;
    }
    static int trylock() {
     h = NULL;
     DWORD pid=getProcess(L"halo.exe");
     if (!pid)
      return false;
     h=OpenProcess(PROCESS_VM_READ, false, pid);
     if (!h)
      return false;
     float pos[3], front[3], top[3];
     if (fetch(pos, front, top))
      return true;
     CloseHandle(h);
     h = NULL;
     return false;
    }
    static void unlock() {
     if (h) {
      CloseHandle(h);
      h = NULL;
     }
    }
    static MumblePlugin AssaultCubePlug = {
     MUMBLE_PLUGIN_MAGIC,
     L"Halo",
     L"Halo",
     about,
     NULL,
     trylock,
     unlock,
     fetch
    };
    extern "C" __declspec(dllexport) MumblePlugin *getMumblePlugin() {
     return &AssaultCubePlug;
    }
    Last edited by Skarma; September 20th, 2009 at 01:49 PM.
    Reply With Quote

  2. #2
    Free Kantanomo English Mobster's Avatar
    Join Date
    Nov 2008
    Location
    Southern California
    Posts
    1,932

    Re: Halo Mumble Plugin(Code)

    What does this do, exactly?
    It sounds interesting, but I'm not exactly sure what it does.
    Reply With Quote

  3. #3
    Codesaurus Skarma's Avatar
    Join Date
    Apr 2009
    Location
    Columbus, OH
    Posts
    227

    Re: Halo Mumble Plugin(Code)

    3d positional sound..so when you are talking to your teamates while playing...it sounds like their voice is coming from their character. Never used it, but when I get my pc working, I'll finish this plugin for Prolak and test it out.
    Reply With Quote

  4. #4
    I was like Um. Delta4907's Avatar
    Join Date
    Sep 2007
    Location
    New York, USA
    Posts
    549

    Re: Halo Mumble Plugin(Code)

    Quote Originally Posted by Skarma View Post
    3d positional sound..so when you are talking to your teamates while playing...it sounds like their voice is coming from their character. Never used it, but when I get my pc working, I'll finish this plugin for Prolak and test it out.
    But Halo doesn't have support for voice.., unless you mean to say this would work if you were using teamspeak, vent, or xfire voice.
    Reply With Quote

  5. #5
    Codesaurus Skarma's Avatar
    Join Date
    Apr 2009
    Location
    Columbus, OH
    Posts
    227

    Re: Halo Mumble Plugin(Code)

    Quote Originally Posted by Delta4907 View Post
    But Halo doesn't have support for voice.., unless you mean to say this would work if you were using teamspeak, vent, or xfire voice.
    Doesn't matter though. It's just like how normal sounds work in game. Say someone is shooting a weapon, you can tell which direction they are because of positional sound the game uses. Mumble takes advantage of that and just applies it to voip. That's what this plugin is for, so it works with halo. And no, it doesn't work for teamspeak or vent, cuz it's for mumble only. Other voip software doesnt have this technology, yet.
    Reply With Quote

  6. #6

    Re: Halo Mumble Plugin(Code)

    Quote Originally Posted by Delta4907 View Post
    But Halo doesn't have support for voice.., unless you mean to say this would work if you were using teamspeak, vent, or xfire voice.
    This is a Mumble plugin, not a Halo plugin.

    Mumble reads Halo to figure out where everyone is and then applies directional sound to them.
    Reply With Quote

  7. #7
    chilango Con's Avatar
    Join Date
    Aug 2006
    Location
    Victoria, BC, Canada
    Posts
    8,397

    Re: Halo Mumble Plugin(Code)

    I've never heard of mumble. Sounds cool, but I guess everyone uses teamspeak now. Maybe you should switch over to this, lancer ;p
    Reply With Quote

  8. #8
    I was like Um. Delta4907's Avatar
    Join Date
    Sep 2007
    Location
    New York, USA
    Posts
    549

    Re: Halo Mumble Plugin(Code)

    I'm still confused as to what this affects, but don't expect me to understand all this "mumble" jumble. (get it? ha.. )

    E: Alright, mumble is a voice chat program, now I [sorta] get it.
    Last edited by Delta4907; September 20th, 2009 at 06:32 PM.
    Reply With Quote

  9. #9
    Senior Member
    Join Date
    Jun 2007
    Posts
    5,414

    Re: Halo Mumble Plugin(Code)

    Quote Originally Posted by Con View Post
    I guess everyone uses teamspeak now.

    looooool

    oh and that's really cool dude

    nice shit
    Reply With Quote

  10. #10

    Re: Halo Mumble Plugin(Code)

    Quote Originally Posted by Con View Post
    I've never heard of mumble. Sounds cool, but I guess everyone uses teamspeak now. Maybe you should switch over to this, lancer ;p
    Maybe I will, at least until TeamSpeak 3 is released.
    Reply With Quote

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •