1

Is there a library for detecting the currently playing song with Java? Not only with WinAMP or WMP, but generally, a technique to listen the audio output for example?

Thank you.

Edit: No, I just want to listen the audio output and decide whether there's a song playing right now, or not. Not identifying. Just there's a song or not (playing right now).

John Doe
  • 633
  • 3
  • 14
  • 24
  • 1
    So you want a library to make Shazam? – Ky - Jun 04 '12 at 21:07
  • I really doubt it... I mean consider it, with all the songs in the world, in all possible languages and all possible sound formats..? – posdef Jun 04 '12 at 21:08
  • 1
    possible duplicate of [Audio fingerprinting library (java)](http://stackoverflow.com/questions/2570847/audio-fingerprinting-library-java) – Makoto Jun 04 '12 at 21:08

3 Answers3

3

You can take the Fourier transform of the audio input and compare it to known frequency distributions of various songs in your database. If they are close enough, you can say that they are the same.

This obviously has some flaws, but it's an idea you can work off of.

tskuzzy
  • 35,812
  • 14
  • 73
  • 140
1

CLAMP is a good choice for WinAMP. People misunderstood the question so hard.

John Doe
  • 633
  • 3
  • 14
  • 24
0

Two things you could try: 1. do STFFT and look for harmonic relationships. These appear in ordinary speech as well, of course, so you'll have to experiment with what kinds of harmonic relationships exist in music vs speech. 2. analyse the envelope for repeating rhythmic patterns.

Bjorn Roche
  • 11,279
  • 6
  • 36
  • 58