Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identifying a mp3 file #1

Open
Gh0s7 opened this issue Jun 30, 2013 · 2 comments
Open

Identifying a mp3 file #1

Gh0s7 opened this issue Jun 30, 2013 · 2 comments

Comments

@Gh0s7
Copy link

Gh0s7 commented Jun 30, 2013

I'm sorry for opening this issue but I can't find the solution to my problem.

I'd like to use jEN to identify and tag a mp3 file which has incorrect informations.

I'm trying something like this:
Track track = en.uploadTrack(file); track.waitForAnalysis(30000); if (track.getStatus() == Track.AnalysisStatus.COMPLETE) { Song s = new Song(en, track.getID()); System.out.println(s.getArtistName());

but it throws an exception

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:604)
    at java.util.ArrayList.get(ArrayList.java:382)
    at com.echonest.api.v4.util.MQuery.getObject(MQuery.java:34)
    at com.echonest.api.v4.ENItem.getItemMap(ENItem.java:242)
    at com.echonest.api.v4.ENItem.getItemMap(ENItem.java:220)
    at com.echonest.api.v4.ENItem.getItemMap(ENItem.java:215)
    at com.echonest.api.v4.ENItem.refresh(ENItem.java:78)
    at com.echonest.api.v4.ENItem.<init>(ENItem.java:36)
    at com.echonest.api.v4.Song.<init>(Song.java:38)
    at echonest.test.EchoNestTest.main(EchoNestTest.java:45)
Java Result: 1
@plamere
Copy link
Member

plamere commented Jul 1, 2013

Gh0s7 - you are attempting to create a Song using a track ID. You need to create a Song with a Song ID. If we were successfully able to resolve your track to a song, then you should be able to call track.getSongID to get the song ID associated with the track.

Paul

@marusso1
Copy link

Is the generation of track fingerprints outside of the scope of this library?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants