R
R
RamiNeIndus2020-05-21 18:57:07
Java
RamiNeIndus, 2020-05-21 18:57:07

How to get sound from java audio output?

Is it possible to get from the PC the sound produced from the inside (youtube, any music). I climbed a lot of forums (including foreign ones), read the Java Sound Api doc, but found only a recording from a microphone.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Cheremisin, 2020-05-21
@leahch

There is a problem with media api in java. But it is not all that bad.
If Java is on Android, then everything is fine, but it's not for me ...
If it's just Java, then there is such a thing - gstreamer, and a good binding for Java - https://github.com/gstreamer-java/gst1- java-core and examples - https://github.com/gstreamer-java/gst1-java-examples
Everything works fine under Linux, I do sound myself, I wrote several applications using gstreamer and java. Works under OSX and Linux. It also seems to work under Windows.
You can also work with gstreamer in python, literally 5 days ago I wrote an application that takes sound from a microphone and posts it to the shoutcast server. Here are examples - https://github.com/GStreamer/gst-python/tree/maste...
In general, you can work with gstreamer in any programming language, from C/C++ to Rust
- https://gstreamer.freedesktop.org/
streams and without.
Ask questions if so.
PS. Yes, java + gstreamer is not a thing for beginners, you must first at least read the gstreamer tutorial, it is sharpened in C / C ++, otherwise nothing will be clear. On the other hand, there is nothing complicated, the main thing is to enter the paradigm of pipelines and message buses.
Yes, with regard to Linux, the sound can be intercepted from almost any application via pulseaudio, and only then, via the pulsesrc plugin, can be taken into gstreamer and your application.
In Windows, you can try to do the same using directshow + gstreamer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question