Results 1 to 12 of 12
  1. #1
    blind melon is offline Member
    Join Date
    Dec 2010
    Posts
    12
    Rep Power
    0

    Default Audio processing in Java?

    So I didn't know where to put this thread, but I'm not relatively new to Java per se, just don't use it that much... prefer C++/perl, but I'm kind of in need to figure out this problem.

    Anyway, what I want to do is basically compare two songs to see if they're similar to each other, and then build on that idea to see if a certain band is similar to another (but that'll come if I get this first baby step under control).

    What I'm looking for is a library that allows for audio processing... basically bringing in the audio clip, and then having some functions that either help with calculating features from the audio clip, like the MFCCs, tempo, rhythm, tone, etc. or actually do just give you those features.

    I was having a hard time with a C++ library called CLAM... just not enough support for it anymore, let alone support for a Windows-based system. That's another point that I'd like to make, I'm running Windows 7, and no, I'm not getting Linux or a Mac (yeah, I'm one of those guys, haha), but I could get cygwin/MinGW if it's necessary. There were some other audio processing libraries, but they weren't very helpful/it doesn't seem like a topic that's in demand.

    So sorry for all of this long winded explanation, but the main question is, is there a library/class or some plugin, like described above, that exists in Java?

    I may have described what I needed a terrible way, so if you need further clarification, please yell at me for making an idiot of myself. Thanks.

  2. #2
    erversteeg is offline Member
    Join Date
    Dec 2010
    Posts
    12
    Rep Power
    0

  3. #3
    blind melon is offline Member
    Join Date
    Dec 2010
    Posts
    12
    Rep Power
    0

    Default

    Nice, that's definitely an awesome starting position. Now I just have to figure out how to use it. Thanks a lot!

  4. #4
    erversteeg is offline Member
    Join Date
    Dec 2010
    Posts
    12
    Rep Power
    0

  5. #5
    blind melon is offline Member
    Join Date
    Dec 2010
    Posts
    12
    Rep Power
    0

    Default

    Yeah sorry, I meant use this class to get the features that I want. I'm sure I'll be able to find some paper or project online that's dealt with audio comparisons or extracting audio features.

  6. #6
    blind melon is offline Member
    Join Date
    Dec 2010
    Posts
    12
    Rep Power
    0

    Default

    So is this class the only way to open an audio file in Java? The reason I ask is because I'm looking at the javax.sound.sampled.* classes, and I see that most of the classes require an AudioFormat class, and it kind of looks like the AudioFormat class takes in the properties of an audio file, but won't open one for me. (I'm not very good with object oriented programming, so bare with me.)

  7. #7
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,960
    Rep Power
    8

    Default

    I'm just thinking out loud (er, in text) here, but you could maybe look into the Music Genome Project. It's what Pandora uses to figure out what songs/artists are similar. Do they have an API?

    Disclaimer: I have not done any googling of my own, so I might be talking nonsense here.

  8. #8
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,960
    Rep Power
    8

    Default

    Quote Originally Posted by erversteeg View Post
    Am I missing something? How will that help with comparing songs?

  9. #9
    blind melon is offline Member
    Join Date
    Dec 2010
    Posts
    12
    Rep Power
    0

    Default

    Isn't there some sort of functionality in Java that just allows you to open an audio file? I was under the impression that StdAudio was part of Java. Has anyone used the javax.sound library? There's got to be a way to just load an audio file using that.

  10. #10
    blind melon is offline Member
    Join Date
    Dec 2010
    Posts
    12
    Rep Power
    0

    Default

    Just an update for anyone that's curious. I got the wav file to load with the javax.sound.sampled library using the AudioInputStream class, and now I'm looking at an Apache Commons Math class that has a fastFourierTransform, so I'm most likely going to be using that in some way to calculate similarity. I also was able to load mp3 files, but I think using wav files will be a lot easier/better.

  11. #11
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,960
    Rep Power
    8

    Default

    Quote Originally Posted by blind melon View Post
    Isn't there some sort of functionality in Java that just allows you to open an audio file?
    I haven't actually done that, but I will need to in the near future, so I did some research.

    Here are the Java sound tutorials: Playing Back Audio (The Java™ Tutorials > Sound) and Trail: Sound (The Java™ Tutorials)

    And here's a very straightforward tutorial from another site: Incredibly Easy Way To Play Sounds - Java Tutorials | Dream.In.Code

    I'd be interested to see what you come up with for comparing songs.

  12. #12
    blind melon is offline Member
    Join Date
    Dec 2010
    Posts
    12
    Rep Power
    0

    Default

    I'll definitely let you know what I come up with, but I'm not sure how good it'll be. I'm really hoping I can have this finished by the weekend, or at least have some song comparisons happening... just all depends on how hard this Apache Commons library is.

Similar Threads

  1. Mixing 2 audio stream threads for java mobile
    By Severus in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 08-21-2010, 06:16 PM
  2. 56K voice modem dial and audio redirect in Java
    By cool4angle in forum Advanced Java
    Replies: 0
    Last Post: 04-26-2010, 09:44 AM
  3. Streaming Audio in Java Application?
    By jfxdd in forum Advanced Java
    Replies: 2
    Last Post: 11-24-2009, 07:13 PM
  4. Problems with Java Audio Recording
    By pars1987@gmail.com in forum Advanced Java
    Replies: 2
    Last Post: 03-27-2009, 10:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •