Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question