GithubHelp home page GithubHelp logo

lagonauta / metaaudio Goto Github PK

View Code? Open in Web Editor NEW
99.0 12.0 14.0 19.37 MB

GoldSrc engine plugin for 3D sound

License: GNU General Public License v2.0

C++ 88.26% C 0.26% CMake 1.58% Batchfile 9.91%
goldsrc openal surround hrtf 3d-audio goldsrc-engine

metaaudio's Introduction

Warning

While the plugin is not a cheat, VAC may flag MetaHook and ban the user. Do not use with Steam in online mode, we are not responsible if your account is banned.

MetaAudio

This is a fork of MetaAudio, a GoldSrc plugin that adds OpenAL support to its sound system. This fork fixes some bugs and uses Alure instead of OpenAL directly for easier source management.

Thus we now have HRTF and surround sound back to our beloved GoldSrc games, and, as this plugin hooks directly into the engine, most mods should work with the new system.

Working games and mods:

  • Half-Life
  • Half-Life: Opposing Force
  • Half-Life: Blue Shift
  • Half-Life: C.A.G.E.D.
  • Natural-Selection
  • Counter-Strike
  • Counter-Strike: Condition Zero ... and possibly more!

What works

  • Sound positioning
  • Distance attenuation
  • EFX effects
  • Voice communication

What is better than current GoldSrc

  • FLAC and OGG support (if Alure2 was compiled with support)
  • Occlusion support like A3D
  • Fade between environmental effects
  • Hardware acceleration (with X-RAM support)
  • Significantly lower audio latency (especially if used with hardware acceleration)
  • "Unlimited" heap size for audio

Console variables

  • al_doppler (sets the doppler effect intensity, 0.3 recommended)
  • al_occlusion (enables or disables occlusion)
  • al_occlusion_fade (enables or disables the smoothening of volumes changes of occluded sources)
  • al_xfi_workaround (can be 0, 1 or 2. Fixes missing sounds when using a X-Fi with buggy OpenAL drivers.)
    • 0: Disabled.
    • 1: MetaAudio will also use the system clock to estimate when the sound effect ended. (preferred)
    • 2: MetaAudio will force all sound effects to be played as a stream.
  • al_occluder (when SteamAudio is available. 0 is GoldSrc-based occluder, 1 is SteamAudio-based occluder)

Console commands

  • al_version (shows current MetaAudio version, along with the current OpenAL device and the OpenAL version)
  • al_show_basic_devices (shows all basic OpenAL, such as just OpenAL Soft)
  • al_show_full_devices (shows the full name of all OpenAL devices, such as Generic Software on Realtek Speakers)
  • al_reset_efx (resets and re-creates all EFX sends, useful for buggy OpenAL drivers that were unable to enable a effect send for some unknown reason)

Executable arguments

  • al_maxsends (sets the max number of simultaneous EFX effects, MetaAudio uses a maximum of 2 but this can limit it to less)
  • al_device (sets the OpenAL device to use, can be OpenAL Soft or OpenAL Soft on Realtek, for example)

Manual Installation

Copy the "metahook" folder to your mod dir.

Copy the other files to Steam's Half-Life dir.

Example folder structure, where can be "valve", "cstrike", "ns", "gearbox" or any other mod:

|%STEAM%\steamapps\common\Half-Life\
|----> metahook.exe
|----> sndfile.dll
|----> OpenAL32.dll (remove to use X-Fi hardware acceleration)
|----> <game>\
  |----> metahook\
    |----> plugins\
      |----> MetaAudio.dll
    |----> configs\
      |----> plugins.lst

One should load the game through "MetaHook.exe". It is recommended to create a shortcut with at least the following launch options: "-steam -insecure -game ". There are two sample shorcut files included, "OpenAL Half-Life" and "OpenAL Natural-Selection".

There should be an "MetaAudio.dll" entry in "plugins.lst".

One Click Installation

  1. You have to compile the MetaAudio by yourself before installation. see Compiling

  2. Run install-to-(WhateverGameYouWant).bat

  3. Launch game from shortcut MetaHook for (WhateverGameYouWant)

  • You should have your Steam running otherwise the SteamAppsLocation will probably not going to find GameInstallDir.

Known bugs

  • Some sounds are too quiet
  • Some sounds does not use the correct source origin

Maybe in the future

  • Integrate SteamAudio for reflections/reverb in addition to OpenAL's native effects

Build Requirements

  1. Visual Studio 2017 / 2019 / 2022, with vc141 / vc142 / vc143 toolset

  2. CMake

  3. Git for Windows

Compiling

  1. Run build-initdeps.bat, wait until all required submodules / dependencies are pulled. (this may takes couple of minutes, depending on your network connection and download speed)

  2. Run build-MetaAudio.bat, wail until all binary files generated.

(legacy) Just load the MetaHook solution, set your post-build event to your desired folder and compile normally with Visual Studio. Tested with MSVC 2019. Remember to install C++ CRT.

The include Alure2 has a slight different API than upstream, therefore must be compiled together.

Debugging

  1. Run build-initdeps.bat, wait until all required submodules / dependencies are pulled. (this may takes couple of minutes, depending on your network connection and download speed)

  2. Run debug-(WhateverGameYouWant).bat, depends on which you are going to debug with

  3. Open MetaHook.sln with Visual Studio IDE, set specified project as launch project, compile the project, then press F5 to start debugging.

  • Other games follow the same instruction.

  • You should restart Visual Studio IDE to apply changes to debugging profile, if Visual Studio IDE was running.

Credits

nagist, for MetaHook (https://github.com/nagist/metahook)

hzqst, for the original MetaAudio (https://github.com/hzqst/MetaRenderer)

Support

Support group available through an XMPP MUC:

xmpp:[email protected]?join

metaaudio's People

Contributors

hzqst avatar lagonauta avatar threedeejay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

metaaudio's Issues

[Azure Sheep] Game may crash randomly

Symptom:
Game may crash randomly, however there seems to be one reproducible crash after Kate is saved. She starts walking by herself and eventually stops at a corner. If the player keeps pressing the USE button on her the game might crash.

Where:
Visual Studio seems to think the crash comes from "hl.dll", however we do not have the symbols to debug.

Probably an unexpected behaviour from MetaAudio is making the mod confused.

Save file near crashing area:
savefile.zip

Mod patched up to malortie changes:
https://www.moddb.com/mods/azure-sheep/downloads/azure-sheep-steampipe-patch-v11

Game is offset when runnning under 1440p fullscreen

When I run Halflife in 1440p via Metahook the screen is zoomed in and shifted so i cant see the menu. ingame its shifted too. Vanilla Half-Life does not have this issue.
I can work around it with -windowed -noborder but it's not fun to play like this because sometimes if I make alot of inputs the borderless window moves a bit.
Running on Windows 10
with the Releasecanidate 1
hl

Some DSP presets aren't too vivid

First of all, thank you for making this mod, it's really amazing to see that you can have amazing audio in all GoldSrc games and mods in 2020 without the need of old WON versions and specific sound card hardware to get it to work!

But after testing it a little bit I realized that some dsp presets in Half-Life with this mod don't sound so "vivid" as the corresponding ones sound like with the Miles Sound System. An example of this are the chamber presets. In Miles it did sound fake (just like almost all of the presets) but it was very intensive and it gave you a really good feel about how big the area was. But with this mod it sounds like a very, very smaller room in comparison.
For instance, the chamber large preset in Miles sounds like a huge chamber that was like, 500 metres across because the sound echoed for a lot of seconds. But with this mod the echo has already died off in just 1 second, which is really weak compared to Miles.

So my idea was to change some of these and make them more intense. Specifically, the chamber, metal, and concrete presets are among the weakest compared to their Miles counterparts. I don't know how much you can do about that however, so if it's not possible just let me know! I think being able to customize their intensity would also be a really cool idea, if possible to implement that is.
(Also random sidenote: The "weirdo" presets also sound nothing like the ones in Miles. The Weirdo 2 for instance sounded like angry bees when there was a loud sound in Miles but in this mod it sounds like there's an echo that comes back to you after a few seconds and never dies off, which is definitely not the same thing if you get what I mean.)

MetaHook.exe Runs But the MetaAudio plugin is not running

image
MetaHook Appears to be running however the plugin isn't

image
Screenshot in-game

I'm not entirely sure what isn't working, I tried following #10 but that changed nothing even going as far as replacing the OpenAL in sysWOW64 and system32 with the 32bit versions I tried downloading the debug build but it sent me to a File Not Found page

Building fails

the building fails on linux, is there compatibillity?

-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:61 (add_subdirectory):
  The source directory

    /home/[user]/Downloads/MetaAudio-master/externals/openal-soft

  does not contain a CMakeLists.txt file.


CMake Error at CMakeLists.txt:63 (add_subdirectory):
  The source directory

    /home/[user]/Downloads/MetaAudio-master/externals/alure

  does not contain a CMakeLists.txt file.


CMake Error at CMakeLists.txt:69 (set_property):
  set_property could not find TARGET alure2.  Perhaps it has not yet been
  created.


CMake Error at CMakeLists.txt:71 (add_subdirectory):
  The source directory

    /home/[user]/Downloads/MetaAudio-master/externals/metahook

  does not contain a CMakeLists.txt file.


-- Configuring incomplete, errors occurred!
See also "/home/[user]/Downloads/MetaAudio-master/CMakeFiles/CMakeOutput.log". 

help

Game startup error

This error happens on last engine build from Steam (#8196 at this time)
I tested it in Half-Life and in other mods, but error happens in any case.
But in the same time, past versions works normally.

Unable to load. Reason:
Failed to create AuxiliaryEffectSlot: Out of memory

NPC voices continue after pausing

When pausing the game most sounds stop, but if it is paused when an NPC is talking, its dialog lines can still be heard when in the pause menus. Most of the time it's not an important issue as it only interferes with the pacing, but I have noticed some cases in which it completely breaks the character's speech and even the progression. That happens, for example, during Half-Life's Hazard Course (tutorial). If escape is pressed when the holographic trainer is talking and then the game is resumed, the speech gets interrupted and the breaking of the script affects the opening of the door and thus makes a restart necessary.
I've noticed this behaviour in the base games and in all the mods I've tried with metaaudio. As I've said it rarely leads to problems, but I haven't found any other references to this issue, so I report it in case it can be of interest.
I'm using the Steam version on Windows 10. This is the output of al_version:

Meta Audio Version: 92b7efb
OpenAL Device: OpenAL Soft on Altavoces (Realtek High Definition Audio)
OpenAL Version: 1.1

Game crashes when talking with voice_loopback enabled

] al_version
Meta Audio 9a51dda
OpenAL Device: Speaker (Sound Blaster EVO Zx)
OpenAL Version: 1.1

] version
Protocol version 48
Exe version 1.1.2.2 (valve)
Exe build: 16:10:54 Aug 10 2018 (7960)

Launch parameters: metahook.exe -steam -game valve -nofbo +al_doppler 0.3

How to reproduce:

  1. Create listen server
  2. Type voice_loopback 1 to console
  3. Press voice button and start talking
    boom.. game crashes or freezes.

Looped wav files, occlusion & other issues

Hello, I've been porting this project over to 007 Nightfire here https://github.com/click4dylan/MetaAudio?organization=click4dylan&organization=click4dylan

My problem is that looped wav files do not work. Someone mentioned the same bug on HL1 but it worked on a pre-release version of meta audio? Any ideas as to how to fix it? Thanks. Also, occlusion appears to be very buggy on Nightfire. It occludes randomly and requires you to be behind multiple walls and sometimes still doesn't work. Thanks

metaaudio fails to compile (c2466: cannot allocate an array of constant size 0)

when i try to compile MetaAudio with "build-MetaAudio.bat", the compiler spews out only this error:

..GitHub\MetaAudio\externals\alure\src\context.cpp(229,24): error C2466: cannot allocate an array of constant size 0

and this is the exact line that causes this error in context.cpp:

const DecoderEntryPair sDefaultDecoders[] = {

i didn't modify any of the code, so i don't know why this happens. i tried fixing it by changing "const DecoderEntryPair sDefaultDecoders[]" to "std::vector sDefaultDecoders".. it compiles, but although the cvars of MetaAudio are present in the console, there's no audio in the game. i'm using visual studio 2019 to compile.

EDIT: nevermind, i was being dumb and didn't notice sndfile library was missing. now it compiles and works fine.

Overlapping audio files

Hi, is there any way to prevent 2 or more audio files from overlapping (happens for example when a scientist is talking and you kill him before he´s finished - he still talks even tho he´s dead, another example is spamming an use key on a scientist - again multiple audio files are overlapping). Could I make the game to stop one audio file before it´s finished when another one is being played? Thank you.

Resolution Issue

Good Evening. Im trying to use MetaAudio with Half-Life,but everytime I try to run it,this happens
image

Metahook doesn't work at all.

I dragged and dropped my files into the appropriate directories and used the shortcut (Modified to point to my Half-Life location), and it doesn't seem to have done anything. No console commands that were associated with Meta Hook appear, so I assume it didn't innitialize.

Obviously I'm using the latest downloadable version, and am using the Steam version.

Doppler Effect

I saw some several people complaining about Doppler Effect pitching/shifting audio too much. It should be improved if it's possible.

[Bug] Instant crash on certain .wav file.

My CS1.6 client instantly crashed when this sound play.

Client version:

] version
Protocol version 48
Exe version 1.1.2.7 (cstrike)
Exe build: 19:53:27 Aug 3 2020 (8684)

I attached the sound file for you to investigate.
crashsound.zip

Linux port?

There does not seem to be a way to use this on linux yet. But will there be a linux port?

Some scripted NPC speech broken

MetaAudio Oct 13 2019 Release
OpenAL 1.1
Half-Life version current at time of posting
Launch parameters: metahook.exe -steam -game valve -insecure

How to reproduce:

  1. Use "map c3a2d" to load last map of Lambda Core
  2. Use "give item_suit" and "impulse 101" to avoid potential bugs caused by not having items.
  3. Proceed to the lab entrance where the scientist opens the door and begins talking.
  4. When he says "I'm sorry to say, but you'll have to kill it" all dialogue stops, even though the conversation is supposed to continue. The NPCs mouths don't even move. Everything else in the game proceeds normally, and you can get the guard to follow you or wait, but he won't say anything. The scientist in the portal chamber won't speak either. In fact no NPC in the game will say a word, even if you load a different save. The only way to get them talking again is to close and restart the game. I also had this happen in a few other instances, such as in Questionable Ethics when you get to the back entrance of the medical lab with the three scientists, but have been unable to reproduce it.

Steam Audio support isn't loading

Steps to reproduce:

  1. Extract the rc1 files to path\to\Half-Life
  2. Extract steamaudio_api\bin\Windows\x86\phonon.dll from the 2.0.18 release to path\to\Half-Life.
  3. Run OpenAL Half-Life

I can't see any of the Con_printf lines in my console, is there some special debugging cvar I need to enable?

Sounds play endlessly

For some reason some sounds loops until game is restarted or level changes. (Mostly reproducable in Garguantua)

Also some sounds still continue to play even when it supposed to stop playing. For example when player kills a houndeye they still play their attack sound even after they die or Egon firing sound still plays after firing is stopped.

NPC mouth issue

NPC's doesn't move their mouth when high quality sound file used.

Enabling MetaAudio.dll breaks CaptionMod

Whenever I enable metaaudio.dll, CaptionMod breaks so that no subtitles are displayed at all. Without a fix or setting it seems like there's not a way to play with the Full Audio Remaster and subtitles.

NPC's jaws doesn't fully close

I don't know if i should been post this in my NPC Mouth issue but it seemed like a different issue..

NPC's doesn't close their jaw fully after they've spoken. Sometimes their jaws left open all the way down or it's a just a bit.
This issue happens randomly. This can be reproduce just by making NPC speak few times by using USE key.

image

Problems with hl from the launcher

a lot of the aspect ratios can just go off screen, the only way I have found to fix this is to plug and unplug my second monitor, and not this happens without a second monitor so I'm not sure if there is another way to fix this otherwise.

The other big problem I have is the mouse input, it puts the mouse too close to the edge of the screen so it shows up when it hits it, and sometimes it just won't lock the mouse at all so I will see it and tab out in my second monitor.

out of memory

Hi,
first of all i want to thank you for your work.
with the last release i cant run Day of Defeat / error message is related to "out of memory". I have tested with a local compiled audio.dll and metahook but the result was the same.

thanks in advance

[X-Fi] Audio pops/clicks in Half-Life

Hi @LAGonauta, we already talked about it in another discussion.
You can easily notice pops or clicks in the sounds in the training level in Half-Life using a Sound Blaster X-Fi.
Currently it is possible to solve this problem by using OpenAL Soft instead of the Creative driver.

I create this as a reminder for a possible fix in the future.

Egon sound is looped after firing stopped

Egon sound still continues playing after firing stopped. This happens randomly.

Meta Audio Version: 92b7efb
OpenAL Device: OpenAL Soft on Headphones (Razer Nari Ultimate - Game)
OpenAL Version: 1.1

Stops working with the recent Half-Life 25th Anniversary update

MetaAudio seems to stop working with this new major update, crashing the game in background as soon when the game started. Checking the View Reliability History on Windows and this happened:
image

The dll file shown the image was related to VC++ error, something that most HL1 mods and even games like CS 1.6 also had the same issue.

Game will still work alongside with MetaAudio if the "steam_legacy" beta build was selected, which downgrades the game to the 2020 version.

EDIT: For those who want a workaround and install MetaHookSv + MetaAudio on HL25, see this paste: https://pastebin.com/L5BTxMVW

Can't play FLAC files

I replaced the music in valve/media from MP3 to FLAC, and whenever I launch the game it won't play the FLAC files.
am I missing something? cause the comment about Alure2 tells me that I would have to compile Alure2 with FLAC to get it working.

Audio glitches

I am getting an issue where every couple of seconds to up to around 2 minutes I get a glitch in the audio in which the sound pixelates, stops comes back pixilated and then returns to normal all in a few seconds.

Custom efx-reverbs.json doesn't work

Hello! I noticed that in one issue that another user reported you posted a newer version of the MetaAudio plugin, which I assume includes the feature that lets you load a customized preset for the reverb effects. However, it doesn't appear to do anything. I've made sure the file is correct, I even took the efx-reverb.sample.json file you provide at this repository to make sure that it wasn't an issue with how the file is written (I renamed it to efx-reverbs.json of course). I also tried to rename it efx-reverb.json (so without the s at the end), but that didn't fix it either. Is there something that i'm missing?
And yes i'm sure I will notice the difference in-game because I made the decay time in the generic preset to be 40 seconds, and walked into the anomalous materials entrance, which uses that preset (the command room_type gets set to 1, which corresponds to generic).

Access violation at alure2.dll from the call of my custom entity

Hello

In my mod, one of the entities I created emits a dynamic sound. There's no problem with the vanilla sound engine. Works as intended. But when I try with meta audio, the game crashes.

I attached a debugger, tried to replicate the event and found out exception is thrown at alure2.dll, by the launcher.CPP

I was going to try to fix the issue by modifying MetaAudio source code but I couldn't find solution files.
Edit: Just found out CMake files but I still can't find the issue.

If you need, here is my entity.

Error with hardware sound acceleration using

In README was stated, that for hardware acceleration it's need to remove OpenAL32.dll
After that, i had this error - what's wrong i've done?
Creative X-Fi Titanium HD PCI-E soundcard, if's it's important.
error

[Crash] Condition Zero Deleted Scenes

The game crash on 1st cut scene audio been played.

Details:
] version
Protocol version 48
Exe version 1.0.0.0 (czerorr)
Exe build: 15:17:55 Jul 24 2019 (8308)

] al_version
Meta Audio Version: 92b7efb
OpenAL Device: OpenAL Soft on Output BlasterX G1 (Sound BlasterX G1)
OpenAL Version: 1.1

That's all, thank you.

Why would metaaudio cause a ban?

Hi! So I really want to play this mod, but I am scared of getting a ban, and I would just like to ask how I could possibly get a ban from this mod if I played this on a server?

HL does not start via metahook.exe

Hi, I am unable to start the Steam version of HL via metahook.exe. All I get is the main menu background offset to the right of the screen (without the menu itself).

I think I am doing everything according to the instructions:

|C:\Program Files (x86)\Steam\steamapps\common\Half-Life\
|----> MetaHook.exe
|----> alure2.dll
|----> libsndfile-1.dll
|----> OpenAL32.dll
|----> valve\
  |----> metahook\
    |----> plugins\
      |----> MetaAudio.dll
    |----> configs\
      |----> plugins.lst

This is the shortcut: "C:\Program Files (x86)\Steam\steamapps\common\Half-Life\MetaHook.exe" -steam -game valve -insecure

I know the shortcut "works" because changing "valve" to "bshift" will load BS background (I have that installed as well).

I tried the same on 2 different PCs (both Nvidia) with exactly the same outcome. One has integrated Realtek sound card, the other has X-Fi Titanium.

Any ideas where the problem could be? HL works fine without metahook.exe.

No support for Cry of Fear?

I have it setup correctly but it seams to hang on startup when attempting to use it. I will admit though, I wasn't completely sure what to do for the shortcut since CoF is standalone instead of a mod; current value is "D:\Steam\steamapps\common\Cry of Fear\MetaHook.exe" -steam -game valve -insecure +al_doppler 0.3

Sound of tank shells flying by stuck on loop

So the recent release seems to have fixed some sound effects not playing however I'm just going through the Surface Tension, the tank section and occasionally when they fire the shell flying by SFX just seems to be stuck in loop even though the shell hit something. The SFX of the shell flying can be continuously heard around the point where it exploded.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.