Package com.echonest.api.v4

Examples of com.echonest.api.v4.Location


        if (!file.exists()) {
            System.err.println("Can't find " + path);
        } else {

            try {
                Track track = en.uploadTrack(file);
                track.waitForAnalysis(30000);
                if (track.getStatus() == Track.AnalysisStatus.COMPLETE) {
                    System.out.println("Tempo: " + track.getTempo());
                    System.out.println("Danceability: " + track.getDanceability());
                    System.out.println("Speechiness: " + track.getSpeechiness());
                    System.out.println("Liveness: " + track.getLiveness());
                    System.out.println("Energy: " + track.getEnergy());
                    System.out.println("Loudness: " + track.getLoudness());
                    System.out.println();
                    System.out.println("Beat start times:");
                   
                    TrackAnalysis analysis = track.getAnalysis();
                    for (TimedEvent beat : analysis.getBeats()) {
                        System.out.println("beat " + beat.getStart());
                    }
                } else {
                    System.err.println("Trouble analysing track " + track.getStatus());
                }
            } catch (IOException e) {
                System.err.println("Trouble uploading file");
            }
View Full Code Here


        List<Song> songs = en.searchSongs(p);
        for (Song song : songs) {
            System.out.printf("%s\n", song.getTitle());
            System.out.printf("   artist: %s\n", song.getArtistName());
            Track rdioTrack = song.getTrack("rdio-US");
            if (rdioTrack != null) {
                System.out.printf("Rdio FID %s\n", rdioTrack.getForeignID());
            }

            Track spotifyTrack = song.getTrack("spotify-WW");
            if (spotifyTrack != null) {
                System.out.printf("Spotify FID %s\n", spotifyTrack.getForeignID());
            }

            System.out.println();
        }
    }
View Full Code Here

        params.setLimit(true);
       
        Playlist playlist = en.createStaticPlaylist(params);

        for (Song song : playlist.getSongs()) {
            Track track = song.getTrack("spotify-WW");
            System.out.println(track.getForeignID() + " " + song.getTitle() + " by " + song.getArtistName());
        }
    }
View Full Code Here

                    System.out.println("Energy: " + track.getEnergy());
                    System.out.println("Loudness: " + track.getLoudness());
                    System.out.println();
                    System.out.println("Beat start times:");
                   
                    TrackAnalysis analysis = track.getAnalysis();
                    for (TimedEvent beat : analysis.getBeats()) {
                        System.out.println("beat " + beat.getStart());
                    }
                } else {
                    System.err.println("Trouble analysing track " + track.getStatus());
                }
View Full Code Here

            }
        });

        shell.add("trackBeats", new ShellCommand() {
            public String execute(Shell ci, String[] args) throws Exception {
                TrackAnalysis a = currentTrack.getAnalysis();
                List<TimedEvent> beats = a.getBeats();
                for (TimedEvent beat : beats) {
                    System.out.printf("%.6f, %.6f\n", beat.getStart(), beat
                            .getDuration());
                }
                return "";
View Full Code Here

            System.out.println(" ---- track ----");
            System.out.println("id      : " + track.getID());
            System.out.println("status  : " + track.getStatus());
            System.out.println("analysis: " + track.getAnalysisURL());

            TrackAnalysis analysis = track.getAnalysis();
            if (full && analysis != null) {
                analysis.dump();
            }
        }
    }
View Full Code Here

        }

        System.out.println(" =========  videos ======== ");
        List<Video> videos = artist.getVideos();
        for (int i = 0; i < videos.size(); i++) {
            Video video = videos.get(i);
            video.dump();
        }
    }
View Full Code Here

                        }
                    }
                });

        for (Artist artist : artists) {
            YearsActive ya = artist.getYearsActive();
            Long earliest = ya.getRange()[0];
            System.out.println(earliest + " " + artist.getName());
        }

    }
View Full Code Here

            return;
        }

        checked.add(artist.getID());

        YearsActive ya = artist.getYearsActive();
        String msg = "";

        yaTries++;

        if (ya.size() > 0) {
            yaFound++;
            int start = ya.getRange(0)[0].intValue();
            int end = ya.getRange(ya.size() - 1)[1] == null ? 2011 : ya
                    .getRange(ya.size() - 1)[1].intValue();

            if (start < 1880L) {
                msg += " too early";
            }

            if (start > 2011L) {
                msg += " too late";
            }

            if (end > 2011) {
                msg += " end too late";
            }

            if (end - start > 70) {
                msg += " probably too long";
            }

            if (start > end) {
                msg += " memento artist";
            }

            if (ya.size() > 5) {
                msg += " many splits";
            }

            for (int i = 0; i < ya.size() - 1; i++) {
                int tstart = ya.getRange(i)[0].intValue();
                int tend = ya.getRange(i)[1] == null ? 2011 : ya.getRange(i)[1]
                        .intValue();
                int nstart = ya.getRange(i + 1)[0].intValue();

                if (tstart >= nstart) {
                    msg += " range overlap";
                }

                if (tend >= nstart) {
                    msg += " range overlap";
                }

                if (tend < start) {
                    msg += " bad single range";
                }
            }

        } else {
            msg += " missing years active";
        }

        if (msg.length() > 0) {
            System.out.printf(" %d %d %d %s %s\n", yaTries, yaFound, yaErrors,
                    artist.getName(), msg);
        }
        if (msg.length() > 0) {
            ya.dump();
        }
    }
View Full Code Here

 
  @SuppressWarnings("unchecked")
  Segment(Map map) {
    super(map);
   
    MQuery mq = new MQuery(map);
    loudnessStart = mq.getDouble("loudness_start");
    loudnessMaxTime = mq.getDouble("loudness_max_time");
    loudnessMax = mq.getDouble("loudness_max");
    List lpitches = (List) mq.getObject("pitches");
   
    pitches = new double[lpitches.size()];
    for (int i = 0; i < lpitches.size(); i++) {
      Double p = (Double) lpitches.get(i);
      pitches[i] = p;
    }
   
    List ltimbre = (List) mq.getObject("timbre");
    timbre = new double[ltimbre.size()];
    for (int i = 0; i < ltimbre.size(); i++) {
      Double p = (Double) ltimbre.get(i);
      timbre[i] = p;
    }
View Full Code Here

TOP

Related Classes of com.echonest.api.v4.Location

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.