Giter Club home page Giter Club logo

win-capture-audio's Introduction

win-capture-audio

An OBS plugin similar to OBS's win-capture/game-capture that allows for audio capture from a specific application, rather than the system's audio as a whole. This eliminates the need for third-party software or hardware audio mixing tools that introduce complexity, and in the case of software tools, introduce mandatory latency.

Internally it uses ActivateAudioInterfaceAsync with AUDIOCLIENT_PROCESS_LOOPBACK_PARAMS. This initialization structure is only officially available on Windows 11, however it appears to work additionally on relatively recent versions of Windows 10.

This plugin is in a BETA state, expect issues - https://discord.gg/4D5Yk5gFnM for support and updates.
An updated version of Windows 10 2004 (released 2020-05-27) or later is required.

Want to support the development of the plugin? https://ko-fi.com/bozbez

overview

Installation and Usage

  1. Head over to the Releases page and download the latest installer (or zip if you are using a portable installation)
  2. Run the setup wizard, selecting your root OBS folder (obs-studio/, not obs-studio/obs-plugins/) when asked (or extract the zip to the portable OBS root directory)
  3. Launch OBS and check out the newly available "Application Audio Output Capture" source

Troubleshooting

  • Application Audio Output Capture source not showing up after install: this means that either your OBS is out-of-date (check that it is at least 27.1.x) or you have installed the plugin to the wrong location. To re-install, first uninstall via "Add or remove programs" in the Windows settings, and then run the installer again. Make sure to select the top-level obs-studio/ folder in (probably) C:/Program Files/.

  • Application Audio Output Capture source not picking up any audio: this happens when your Windows is too old and does not have support for the API. Note that even if you have a more recent major version such as 20H2 you will still need the latest updates for the plugin to work. If you are on a very old version you might need more than one update for this to work, and the second update might not show up for a few days after the first update.

win-capture-audio's People

Contributors

alphakr93 avatar avitomin avatar berserker66 avatar bozbez avatar clementbonnoron avatar demojameson avatar farivar-tabatabaei avatar gxalpha avatar hza336 avatar jumoog avatar kaleidonkep99 avatar montejojorge avatar orion78fr avatar pcislocked avatar qqquiu avatar reticulmz avatar sanchezlucas avatar shiina424 avatar thislinked avatar vladimirok5959 avatar walker-wsh avatar yuna0x0 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  avatar  avatar

Watchers

 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

win-capture-audio's Issues

plugin not picking up audio

i downloaded the plugin via .exe file and the plugin does't seem to pick anything up, i'm new to obs and streaming so i don't quite have enough knowledge to know the problem myself.
wanted to be able to have separate audio tracks with the plugin so i didn't need anything external
image

Capture exclusion only on primary output device

Hello,
First of all, congratulations for the tool that you offer us, it is really very useful and allows to get rid of "Voicemeeter" and even "virtual audio cable", which very few people need.

Following my various tests I have noticed one problem and one improvement that I would like to share with you:

  • For the improvement, the application audio capture works perfectly, but would it be possible to make it capture the application from a or source directly?
    For example, let's say I play CSGO and then switch to Minecraft, rather than changing the game capture and then the audio capture, would it be possible to have the audio capture change automatically if a specific source of these two types is changed?
    (I specify both types because some games don't work in game capture but in window capture and vice versa)

  • For the problem,
    there is a problem between , Voicemod and the monitoring function of OBS,
    I explain, the problem is that when you check this box, the audio capture will capture all the playback devices without exception, and not only the main or default audio, but the problem is that voicemod to work necessarily uses an audio output (that you can not disable) which is called :
    Voicemod Virtual Audio Device (WDM)

So it's going to capture our microphone constantly, whatever we do, it also means that if a webcam or other software creates an audio output it will be captured, even if it's used for monitoring (and so we don't want it to be captured), maybe allowing an option to choose the main audio output of the pc on this plugin would be interesting (without forcing it on the default output because some can navigate between several audio outputs for other mixing reasons)
Or even better allow with a parameter or something to add playback devices in exclusion to never capture them?

Regarding monitoring, the problem is that if on OBS you enable monitoring to hear for example the music added in media source or VLC, or to hear the sound alerts (don, sub, etc...) on a , well the same parameter "Capture all audio EXCEPT the selected window" will obviously capture it.
So since OBS is in the list of windows, if we choose it, it works, the monitoring is not captured anymore and it's perfect, but the problem is that it prevents us from excluding several windows.
What would be really great would be to be able to choose several windows to exclude (for example Discord, OBS, VLC) at the same time.
Especially since I think this exclusion list feature would be useful for 90% of the people who use this tool.

**Thanks again for this great tool!

I hope you can fix the bug with Voicemod easily, and that you can propose the possibility to make a list of applications to exclude rather than one only window in the future**

More of a question.

I saw this plugin featured on Epovox's YouTube channel and I had a question regarding it. Does this plugin support games such as Valorant and League of Legends, or such games such as Sea of Thieves?

Multiple instances (assigned to exes not currently running) in one scene collection leads to OBS freezing and crashing

First off I should say that I understand if the plugin isn't meant for something like this. My use-case / setup is a scene collection of a number of games that I hop between; each of them have their own scene, just consisting of a Game Capture (for that specific app; I play everything borderless windowed so default game capture usually doesn't work) and Application Audio Capture. I get that this might not be a 'typical' usage.

When this scene collection is loaded, every 2 seconds it's trying to hook 12 Application Audio Captures to games that aren't running (or, naturally, 11 if I am running one of those games). This adds a lot to the log, which I wouldn't mind but it also seems to eventually crash OBS. This has taken anywhere between 40 minutes and 80 minutes to happen.

On this scene collection, the OBS UI slowly becomes less and less responsive - the mixer levels hitch and hang and the menu buttons take a while to light up when moused over. This starts out imperceptible and gradually gets worse and worse. The video preview, however, is fine, and recordings are also fine. I can provide a video of this if desired.

However, after a period of time, it causes OBS to become unresponsive completely. It freezes and I have to hit the X to quit out, and go through a windows prompt. It does not generate a crash log. The run log ends with whatever it was doing last - in these cases, just repeated checks for applications:

23:24:44.384: [audio-capture: 'SlayTheS...'] (set_update_timer) setting timer for 2000 millis23:24:44.384: [audio-capture: 'Overwatc...'] (set_update_timer) setting timer for 2000 millis

23:24:44.971: [audio-capture: 'Control ...'] (set_update_timer) setting timer for 2000 millis
23:24:44.971: [audio-capture: 'Before W...'] (set_update_timer) setting timer for 2000 millis
23:24:45.286: [audio-capture: 'Yakuza L...'] (set_update_timer) setting timer for 2000 millis
23:24:45.322: [audio-capture: 'TonightW...'] (set_update_timer) setting timer for 2000 millis
23:24:45.322: [audio-capture: 'Minecraf...'] (set_update_timer) setting timer for 2000 millis

For what it's worth, each log that OBS crashed in is over 1000kb in size, ranging from 1001 to 1313.

It does however create an entry in reliability history, for audio-capture-helper.exe at the same time as an OBS crash. Here are the details for audio-capture-helper.exe:

Description
Faulting Application Path:	C:\Program Files\obs-studio\data\obs-plugins\win-capture-audio\audio-capture-helper.exe

Problem signature
Problem Event Name:	APPCRASH
Application Name:	audio-capture-helper.exe
Application Version:	0.0.0.0
Application Timestamp:	6130c84c
Fault Module Name:	audio-capture-helper.exe
Fault Module Version:	0.0.0.0
Fault Module Timestamp:	6130c84c
Exception Code:	c0000005
Exception Offset:	00000000000018c9
OS Version:	10.0.19043.2.0.0.768.101
Locale ID:	6153
Additional Information 1:	0497
Additional Information 2:	04972d7d7c13bf028cce66b0fb84661d
Additional Information 3:	dc0c
Additional Information 4:	dc0c95a8bfbfd8c3a46d2abdc9a0c10c

Extra information about the problem
Bucket ID:	0da8bbe6a031a2e956aadc01b332459b (1633359714734720411)

This information is consistent between entries.

However, this does not seem to happen on a scene collection with only one instance of an Application Audio Capture Source that is searching for a program that isn't running; I left OBS open on that scene collection for five hours and though there was a tiny hitch every 2 seconds (presumably from the AACS looking for its app) it was fine.

Is there anything that can be done or is there nothing for it beyond 'stop using a scene collection this way'?

I have attached a log but given it just infinitely searches for its applications for 40 minutes then crashes, with no crash message, I doubt it will be useful.

EDIT: some formatting to denote error messages

2021-09-07 22-42-16.txt

SWTOR doesn't work

It can capture SWTOR audio if I check the box to get all other sound except the current window, but The Old Repblic sounds do not come though using normal window capture method. Game coding issue? DirectX issue? My other games work :D and this has been really awesome to use with discord and rocket league for tournaments.

Doesnt work with terraria

When trying to use it with terraria it either gives an encoder error or has really bad clipping.
Turning down the volume in obs somewhat fixes the clipping but the errors still happen.
I also tried turning down the volume in terraria which didnt do anything even if i had the volume at 0%

Does not automatically show on Audio Mixer

Windows 10 Pro 10.0.19043 Build 19043

Having an issue with the source not appearing on the Audio Mixer unless I toggle "Hide from Mixer" on and off.
I'm utilising studio mode, so I add the source then push it to program.
And since it doesn't show, I do the above method then re-push to program.

Next updates

Hello!

First of all, thank you very much for your work, this is an amazing plugin.

I would like to suggest a couple of enhancements for the next versions, if you think that's possible :)

  1. Easy to extract releases for portable OBS instances: it would be great if the final zip archive available in the releases section, a zip file that we could just extract to the portable installation, with the correct data and obs-plugins folders inside.
  2. Integrate with the native game capture source: not sure if possible or if it could break something, but, would be great if we could use the same source for capturing both the game image and audio, for example.

Thanks!

Migrate to ActivateAudioInterfaceAsync with AUDIOCLIENT_PROCESS_LOOPBACK_PARAMS

Windows 11 introduces a new initialization structure to use with ActivateAudioInterfaceAsync that allows capture of per-process audio, including optional capture of a process's children: AUDIOCLIENT_PROCESS_LOOPBACK_PARAMS.

Initial investigation using Microsoft's sample application shows that even though this API is publicly exposed only on Windows 11, it is still usable since Windows 10 version 2004 (released 2020-05-27) and the only requirement is the inclusion of audioclientactivationparams.h from the Windows 11 SDK.

Using this would allow us to avoid hooking altogether, completely eliminating all of the compatability issues including Chrome/Electron and games with strict anti-cheats, as well as being an order of magnitude easier to implement and maintain.

Exclude multiple

I suggest adding to the Capture all audio EXCEPT the selected window feature, and allow it to select multiple windows to exclude.

Audiosource with "Capture every audiodata EXCEPT the selected window" not working when selected application not open.

Hi,
i found a (bug) feature that is kinda a problem. I selected in the settings of the application audio source a windows (Twitch Soundtrack) and clicked the checkmark for "Capture every audiodata EXCEPT the selected window". Now everything was working fine. It capured my desktopaudio without Twitch Soundtrack. But here is the problem: When you start OBS and the other application that you selected in your application audio source is not open the complete audio source is not working.

Can you please add a function that the source still working if the selected application is not open?

Hope you have a good day :)

OBS Hang when exit

OBS Hang when Exit/Close OBS
issue happen when application that need to capture/hook is not running
if application that used to capture/hook is running, Exit/Close OBS won't hang..

i do notice that v2.1.0 beta released,
so base on the desciption,
i remove all v2.0.0 beta 3 source,
uninstall plugin (i use exe installer),
install new v2.1.0 beta version plugin (exe installer),
add source and select capture Discord,
exit OBS, no hang because discord is running..
exit Discord, open OBS, exit OBS, OBS Hang..

checked winver, i on Windows 10 Pro x64 version 2004 OS Build 19041.1288

*Problem exist when using v2.0.0 Beta 3

when OBS is hang while exit, and i force it to close without waiting for respond (which wait for respond 1 hours still hanging)
the log is look like this
01:54:36.603: ==== Shutting down ==================================================
01:54:36.826: WASAPI: Device 'XV340CK P (NVIDIA High Definition Audio)' Terminated
01:54:36.835: WASAPI: Device 'Headset Microphone (Oculus Virtual Audio Device)' Terminated
01:54:38.047: WASAPI: Device 'Microphone (Yeti X WoW Edition)' Terminated

when OBS success Exit properly, the log file is like this
01:56:19.772: ==== Shutting down ==================================================
01:56:20.030: WASAPI: Device 'XV340CK P (NVIDIA High Definition Audio)' Terminated
01:56:20.037: WASAPI: Device 'Headset Microphone (Oculus Virtual Audio Device)' Terminated
01:56:21.423: WASAPI: Device 'Microphone (Yeti X WoW Edition)' Terminated
01:56:22.882: [audio-capture: 'unknown'] (audio_capture_worker_tick) shutting down
01:56:22.888: All scene data cleared
01:56:22.888: ------------------------------------------------
*** and lot of usual info below **

Does not appear to work nicely with Valorant

When I added the audio capture for Valorant, it took the game from 300fps for me to 2fps, essentially making it unplayable, and the only way I could resolve this issue was by deleting the audio capture source from my OBS scene.

Discord severe gaps and glitchiness

Windows 10 Pro 10.0.19043 Build 19043

Discord audio capture seemed to have some weird glitchiness after some time of use. It slowly become worse as time progressed (not sure if that could be syncing issues?) but I had to swap back to Desktop Audio after I was notified of the issue. Note that sound was just fine through Desktop Audio and through my headphones. Even in OBS, the audio meter showed everything was fine. Even another source (Overwatch) was doing fine.

It got worse when transitioning through scenes so potentially this could be the culprit?

Shown here: https://www.twitch.tv/videos/1135794206?t=00h09m53s

Crashes a lot of games on first hook

It appears a lot of games crash the first time they get hooked, noticed this in GTFO, Raft and a few other games. Unity, UE4 and other engines so it doesn't seem to be an engine specific issue

Buzz when recording Chrome and Spotify

When I try adding an audio source for Chrome or Spotify in the new 2.0.0-beta, one of the audio channels is constantly filled with a buzzing noise, for example, Chrome (see left audio channel for the "Chrome" source):
image

When I disable that audio channel to test if the other channel is clean, any sound made is accompanied with a small buzz/crackling on top (see this footage from a YouTube video on Chrome):

buzz.mov

My current configuration for the source is as follows (but I have tried different configurations with no luck):
image

Thanks for the awesome plugin!

README.md Discord Link

Very quick heads up.
Discord link is broken and just in case someone attempts to use it, I am posting this issue to try resolve it asap.
Sorry :)

Audio crackling/popping stutter under load

Plugin version: v2.0.0-beta

When the captured application is under load (for example a game experiencing lag), the captured audio will crackle and pop, sometimes cutting out and back in depending on the severity of the lag. This happens with both a direct capture and an indirect capture ("Include process tree" unchecked and targeting another application). These audio issues do not occur when using a standard audio source capturing the audio device that the application is outputting to. The threshold of this crackling seems to be quite low, with even a slight dip below my v-sync causing problems, so I suspect some sort of bottlenecking?

I'm unsure if this kind of issue is resolvable, but I felt it was worth reporting regardless

Application Audio not picking up any sound

OBS audio screenshot 1
I have just recently installed the plugin along with multiple friends to record multitrack audio separating game audio from discord, except neither of them are being picked up even though I have the right window and track selected while there is sound being output by those applications. My friends who downloaded this at the same time have had none of these issues despite setting it up the same way, and I have OBS fully updated and have tried restarting it. Is there a bug, or something obvious that I'm missing?

Windows Defender flagging win-capture-audio as trojan

This has me panicked due to trying to keep my system clean, I'm concerned about why this has only come up now despite my scanning it a week ago with no flag:
image
image

This doesn't seem to be an issue with Opera GX or other EXE's since it's only come up for this one...

Question: ASIO Support

Will it be possible to use this plugin to capture ASIO audio?

A lot of DAW's using it to output sound. Switching output to MME/DirectX adds latency and makes work pretty uncomfortable

Plugin does not capture audio from OBS

Hey there,

The plugin does not detect OBS as an audio source.

This becomes an issue for alerts, as alerts are played through OBS itself.

If this could be resolved, that'd be great, as I love what this plugin does.

Plugin isn't capturing the audio

After I downloaded zip file, and copied files from it to obs root directory, Application Audio Output Capture" source appeared, but when i tried to test it and captured my browser, i saw that the plugin isn't working. As shown in image, my desktop audio captures browser audio pretty easily, but plugin is just not working. I tried to reinstall the obs 2 times, tried with plugin installer app, nothing helps. How can I fix it?
8biWPYhTGW
изображение

Capture all audio does not work if the target application is closed

Plugin version: v2.0.0-beta.2
I have OBS currently set up like this:

  • Source 1 is "Spotify audio output", which only records the output from the target application Spotify.exe
    image

  • Source 2 is "Audio output w/o Spotify", which records the entire desktop audio except for Spotify.exe (Capture all audio EXCEPT the selected window is enabled)
    image

When the target application is closed, there's no audio in Source 1, but that's okay.
The issue is that there's no audio on Source 2 as well, which is supposed to get the entire desktop audio, even when the target application is closed.

SNDCPY not showing

I've got a problem. SNDCPY is using vlc.exe in background. Then it isn't a window. That's why win-capture-audio can't recognize vlc as audio source. But the audio is working perfect.

I want to know how to add vlc.exe if it's not showing as window.

image

Audio spikes and capture crashes.

When used, I get frequent 100% audio spikes which are just not present in the source audio.
Probably related, the recording or stream will crash shortly after these begin.

Disabling the source stops the crashing.

Only captures Spotify sometimes

Issues:
Only captures spotify is a song is already playing, if song is paused for too long it will not capture audio when resumes and when transitioning to a new song it stops capturing after a couple seconds(cross fade on)

Gif:
Spotify weird stuff

Can't reinstall

I installed this plugin in the wrong location, and now I can't change the install location anymore

About timing of add new win-capture-audio source in Audio Mixer

Hello.
First of all, thanks for create really good plugin. And sorry of my english low level.

obs: 27.1.3
win-capture-audio v2.0.0-beta.3
windows 10 Pro 21H1 (os build 19043.1266)

I found out this situation in my desktop.

  1. push plus(+) button in Sources tab
  2. Add source win-capture-audio source normally
  3. Even if see audio mixer tab, can't see volume controller of new win-capture-audio source
  4. shutdown obs, and re-execute
  5. can see new source of win-capture-audio in mixer tab

Is it the normal? or abnormal?
Thanks for reading.

Add integration with game-capture

As mentioned in #1, currently the user must select a game in both the game-capture and audio-capture settings windows (if they are not using the hotkeys). An idea to improve this would be to add a third mode "Same as game-capture" with a dropdown of the game-capture sources the user has in their current scene.

As far as my (limited) knowledge of OBS plugins goes, to implement this we would need to:

  1. Enumerate the game-capture sources in the scene
  2. Extract either the game-capture private context or the private obs_data_t settings object
  3. Peek the required information for us to identify the same process as the game-capture source
  4. Monitor updates to said context or settings object to track and updates to the target process

Step 1 is likely quite easy, but 2, 3 and especially 4 look to be awkward and hacky.
For now this is somewhat out of scope until the stability and compatability of the hook has improved.

Alternatives such as integrating directly with the game-capture plugin are also worth considering, but would require the plugin to be merged into OBS master.

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.