Reputation: 63
I want to read mp3 file and extract its features which I will use further for identifying mood of song. Can u help me in extracting feature of mp3 and which feature will b most appropriate for mood identification?
Upvotes: 1
Views: 839
Reputation: 6452
java_mp3 is simple API which provides the MP3File wrapper over native java.io.File. Then you can call the getters to access its metadata. Though it is not supported anymore as far as the last bundle date says, but it works, ID3v2 does not change over time, so its ok.
Description says:
A Java library to read and modify ID3 and ID3v2 tags on MP3 files and gather extended information about MP3 files.
There is similar answer on StackOverFlow, which suggests using JAudioTagger which supports reading MP3 ID3v1,ID3v11, ID3v2.2, v2.3 and v2.4 metadata.
Then you can write your own algorithm defining mood of songs based on gathered metadata analysis.
Upvotes: 2
Reputation: 36723
You could start by working out the BPM. I found this random BPM detector in java, which you might be able to use.
if (bpm > 180) {
// frantic
} else if (bpm > 140) {
// bouncy psytrance
} else {
// "down beat"
}
Or maybe you could use this opensource project for music identification called Echoprint, then programmatically search for song on google and tag cloud the results.
Upvotes: 2