I know there is a duplicate question right here, but it's obsolete, so does javafx support audio capture.
Does it have any audio capturing API or interfaces, i know of AudioClip in javafx.scene.media. but it's only for playback.
No, JavaFX 8 does not have an audio capture API.
There is an existing feature request (currently scheduled for implementation in Java 9):
JDK-8090438 Camera and Microphone
For now, you can use the existing javax.sound API (which will probably work just fine from a JavaFX application), as suggested in Robin Jonsson's coment.
Related
I had a small JavaFX application to play some GoPro videos on a windows / linux client. In the past I had using a GoPro 4. I've downloaded the video to the client and play it from the local storage. Like this:
File file = new File("AnyVideo.MP4");
Media m = new Media(file.toURI().toString());
MediaPlayer mp = new MediaPlayer(m);
mp.setAutoPlay(true);
mediaView.setMediaPlayer(mp);
I'll try to switch to the new GoPro 6 now. But it doesn't worked as expected.
The problem is probably that the JavaFX MediaPlayer did not support the codec from the new GoPro 6.
GoPro 4: h264 AVC video codec
GoPro 6: h265 HEVC video codec
The JavaFX MediaPlayer supports only the h264 codec.
Did anyone know a way how I can play a h265 HEVC video with my JavaFX application. In the best case a solution wich can play the video immediatly from the camera without download the video first to the client. The GoPro has a smal Media Server to get the video over HTTP. as example:
http://10.5.5.9:8080/videos/DCIM/100/GPR10973.MP4
Native JavaFX Solution
Perhaps this is a duplicate or at least related to:
Adding other video codecs / DVD support to JavaFX 2.2.
See my answer to that question for links to related feature requests in the JavaFX bug tracker system.
Solutions using non-JavaFX tech from JavaFX
There are other solutions than those discussed in answers to that question which may work for you. Especially if your primary concern is just getting some kind of playback, even if it doesn't have deep integration with the JavaFX media system.
For instance, other approaches than native JavaFX playback could be:
Using VLCJ with some kind of Swing integration (such as a SwingNode, though that may or may not work).
Rendering the VLCJ video into a JavaFX ImageView or Canvas.
See related: Playing Video in Java FX using vlcj api.
Which links to the following project: https://github.com/caprica/vlcj-javafx.
Launch a native video player if you don't need the video embedded.
Perhaps Desktop.open() or the Process API could do this.
Call ffmpeg to convert h265 to h264.
I don't know much about this, but a quick google of the topic shows up references to the xuggle project.
Current status of the xuggler project is:
Xuggler is on hiatus as no one is actively developing it anymore. Sorry. That said, you can always find the source code and start hacking yourself. Good luck!
So I wish you good luck with that ;-)
Launching the native browser through a HostServices.showDocument() call to display the video.
Use a third party browsing component that can be integrated into JavaFX and includes support for the media type you want to play back, for example JxBrowser:
H.265 support in jxbrowser
Of the options outlined above, personally, I would recommend using HostServices to play the video in the native browser if that kind of solution will possibly work for you.
Going into detail on various options is probably out of scope for StackOverflow (even the above list starts looking like a sometimes frowned upon library recommendation).
I'm using Java to read and play some real time audio streams such as the voice from radio station.
I have the real time web address like this one and it can be played in a web browser.
How can I play it using Java language?
Thanks.
MP3SPI is a Java Service Provider Interface that adds MP3 (MPEG 1/2/2.5 Layer 1/2/3) audio format support for Java Platform. It supports streaming, ID3v2 frames, Equalizer etc. It is based on JLayer and Tritonus Java libraries.
You can use this library MP3 SPI for Java Sound , and its documentation here.
Library reference
I'm writing a video recording program, and it's going quite well. I can record mic as well as video from the screen. However, I would also like to be able to obtain sounds from another Java program and then sync them with the video. Basically, record the audio as it is played by the other program.
Is there a way to accomplish this? I'm pretty new with sound, and have read a bit up on it. I think I need to set up a mixer, but I'm not sure if I can actually obtain sound from another Java program that way.
This is not possible with java sound, not because of any particular problem with java sound, but because not all audio APIs that java builds on support this feature. (Core audio on the mac for example, and ASIO on windows. Not sure about ALSA on linux, but I don't think it supports this either).
If you are on windows and want to write JNI/JNA code you can use PortAudio which supports this on one of the audio APIs (sorry I can't recall which one).
Hi Guys I am trying to build a "4-track" recording app on Android.
I'm looking for a library or set of classes I can use record audio and mix 4 channels of audio to a 2 channel "mixdown".
Ideally it would be similar to the javax.sound.sampled library.
Low latency is also important...
I am new to Android development and have only worked in web dev for a year (c#, jquery, sql, vb).
You will likely have to do an implementation of AudioTrack. This will give you the most control.
Ref:
http://developer.android.com/reference/android/media/AudioTrack.html
Android: Mixing multiple AudioTrack instances?
Could anyone tell me, Where can i find api for waveTable syntesis on android?
Or maybe i can use one of C++ waveTable synth libraries on android through JNI?
MediaPlayer and JetPlayer does not fit for this task.
I need to play MIDI, but with good soundbanks and be able to change soundbanks on user request.
AFAIR there's no API for this in SDK. If you want to play midi on android use MediaPlayer to do the playback (it does support midi files)