Java - detect if application sound

For my weekend weekend project, I am trying to create a simple program that waits for a program / process to output any sound, and when / if it does, do something.

in pseudo code:

if (application.outputsSound()) { /* Do something */ } 

For starters, it can be any sound coming from a specific application, but if within the reason it detects a certain sound based on the stored audio file, that would be really cool.

My thoughts: I suppose I need some kind of native library (JNI / JNA), but since I'm new to this, it would be very convenient if someone could point me in the right direction.

+5
source share
1 answer

On Windows, you can use the IAudioSessionEnumerator interface

https://msdn.microsoft.com/en-us/library/windows/desktop/dd368281(v=vs.85).aspx

Although this is not ideal, as third-party audio stacks will not be displayed, such as ASIO.

On Linux, it depends on which environment you are using.

0
source

Source: https://habr.com/ru/post/1235480/


All Articles