I am working on a chat application in java. My program need to play sounds at regular interval as the message arrives. What are the sound format should I choose to play on (Windows/Linux/MacOS) platforms, without using external liberaries
Sound-formats are all platform independent. The question is: Is there a Codec on the target platform which supports this format.
If you're developing a chat-application i guess you won't use high quality audio things, so Sun Audio-files should work for you. Check out this older post on how to use them.
For some reason .ao seems to be the lowest common denominator for Java, while .wav seems to be used almost everywhere else for notification-sounds (or possibly even .ogg or .mp3).
Related
I need to extract a single frame from a video file to use as a thumbnail. I would like to be able to generate thumbnails from most common video formats and would also like to be cross platform, so a pure Java solution is preferential.
It would be also useful to be able to get additional information about the video such as frame rate and total length so I can get a frame from a specific place in the file.
I have looked at Xuggler but it appears to be depreciated.
Assuming you want to do this server side, then it may be easiest to leverage ffmpeg as it is commonly used for this type of video manipulation and it also has a large user community.
As ffmpeg is C based, using it with Java requires some sort of wrapper or JNI approach so it is not strictly speaking pure Java, but it is common to use it this way in Java programs. An example wrapper library, which seems to be regularly maintained, is:
https://github.com/bramp/ffmpeg-cli-wrapper
all i want is suppose i have same song named as song.mp3 and song.aac now i want my program to identify that they are same, i know this is non-trivail task to do.
so far i have tried fingerprinting audio using dejavu python library which produces 2 different fingerprints for our case song.mp3 and song.aac, hence it doesnt suit need of my program.
I also tried MD5 using FFMPEG but as expected it gives different hash for even same songs downloaded from different websites
Do you guys have any idea how do I proceed?
It would be even great to provide me step wise procedure and library to achieve my goal.
thank you
Audio fingerprinting is incredibly complex, and difficult to get right. You do not really want to come up with your own algorithm just like that, because it likely is much worse than established methods (being better than established methods requires doing some research ;-)).
One of the open source solutions for audio fingerprinting which I found is http://echoprint.me/codegen
You can use that in your application, either by calling directly into the libcodegen API, or by spawning subprocesses for audio analysis.
I have a problem with MP2 audio files and JAVA. Audio seems to be a pain in JAVA anyway. I tried using JavaLayer and Xuggler to decode and transcode the MP2 file to WAV. Both of which failed. And development of those seems to be not active. Although many are still using these. JMF or FMJ I haven't tried yet. I was wishing for more native approach.
I ended up forking JavaLayer to my project. And with a small code change I managed to seemingly get it to read all the frames from the MP2. But trying to convert it to WAV resulted in a file playable only in VLC and well, it was recognizable but distorted.
Anyway, a broad question, I apologize. I guess I'm asking that is there any JAVA + JavaLayer + MP2 gurus out there who can help me?
Original MP2: https://dl.dropboxusercontent.com/u/90134918/horng014.mp2
Failed WAV conversion: https://dl.dropboxusercontent.com/u/90134918/horng014_fail.wav
I have a public GitHub account for this project, but I haven't posted this broken code there yet.
Meanwhile theres's a new Java Media Framework here:
https://sourceforge.net/projects/doppio/
with a high level API for players and a low level API for using only decoders.
This player here https://sourceforge.net/projects/xamp2/ based on this media framework and can play mentioned file. Also the stuff is open source.
After stepping through jlayer1.01 in debugger, I conclude there are only two possibilities:
Either jlayer decodes the header word wrong, or jlayers tables and code are correct and the file's parameters deviate from what the standard defines. I lack the knowledge and time to find out wich of the two is the case.
Just because jlayer hasn't been updated for a few years does not necessarily mean its abandoned; it generally works very well with the average MP3. Why should there be an update if there aren't any known bugs left?
MP2 isn't exactly common these days; actually it hasn't even been that common 15 years ago, so it might well be the case there is a still unknown bug. Try filing a bug report and give it some time.
The MP2 file is is correct and MP2 is common these days, the MP2 Encoder twolame is up to date with enhanced VBR encoding. You can play the file with common players. There are two different bugs in JLayer: 1. The frame size calculation is wrong and 2. A Bit allocation table for MP2 Low Sampling Frequency (Mpeg2-Layer2) is buggy.
I'm looking to write a voip application, I know JMF has RTP code but it's old and 32bit only. Is there a robust library that does RTP/RTSP that can be used with java?
Thanks
no way JMF - its 10 years out of date
list java RTP RTSP packages:
RTSPClientLib.tar.gz on code.google
http://github.com/brunodecarvalho/efflux
i used the efflux on a java project and it was worth the time learning his packages. The combined netty/efflux is very robust on the variety of RFC's involved in networking underlying RTSP/RTP.
i think i have an eclipse project archived somewhere using efflux for alot of RTSP dialog type stuff.
I am a student and as a project i have to implement a barcode(1-D) based attendance marking system.While surfing across the web i came to know that barcode readers are a bit costly toys to purchase,so now what I want to do is I want to capture images of barcodes through a capturing device(mostly a webcam) and then process them to get the content stored in it.
I found a few projects on the internet that do the same but they use .NET f/w and I am not so familiar with .NET technology. The only project that uses java is http://sourceforge.net/projects/javabarcoderead/ but somehow i am not able to run the jar file they are providing.
SO, I would like to know about the algorithms or methods that can be used for the same or even any project from where i can get some insight on how to move further with this...
Happy Coding...
You're right, it would be very difficult to use a library with no documentation and no source code.
I'd suggest using ZXing. It's a well-documented library with lots of examples.