Package com.echonest.api.v4

Examples of com.echonest.api.v4.Location



        System.out.println(" =========  bios ======== ");
        List<Biography> bios = artist.getBiographies();
        for (int i = 0; i < bios.size(); i++) {
            Biography bio = bios.get(i);
            bio.dump();
        }

        System.out.println(" =========  blogs ======== ");
        List<Blog> blogs = artist.getBlogs();
        for (int i = 0; i < blogs.size(); i++) {
View Full Code Here


        }

        System.out.println(" =========  blogs ======== ");
        List<Blog> blogs = artist.getBlogs();
        for (int i = 0; i < blogs.size(); i++) {
            Blog blog = blogs.get(i);
            blog.dump();
        }

        System.out.println(" =========  images ======== ");
        List<Image> images = artist.getImages();
        for (int i = 0; i < images.size(); i++) {
View Full Code Here

    public static void main(String[] args) throws EchoNestException, IOException {
        EchoNestAPI en = new EchoNestAPI();
        Song lastSong = null;
        en.setTraceSends(false);

        DynamicPlaylistParams params = new DynamicPlaylistParams();
        params.setType(PlaylistParams.PlaylistType.GENRE_RADIO);
        params.addGenre("dance pop");
        params.setMinEnergy(.6f);
        params.setMinDanceability(.6f);
        params.includeAudioSummary();
        DynamicPlaylistSession session = en.createDynamicPlaylist(params);


        boolean done = false;
        while (!done) {
View Full Code Here

        params.setType(PlaylistParams.PlaylistType.GENRE_RADIO);
        params.addGenre("dance pop");
        params.setMinEnergy(.6f);
        params.setMinDanceability(.6f);
        params.includeAudioSummary();
        DynamicPlaylistSession session = en.createDynamicPlaylist(params);


        boolean done = false;
        while (!done) {
            String keys = "nsfd+-";

            System.out.println();
            System.out.print("(n)ext (s)kip (f)av (d)one (+)faster (-)slower ->");

            int cv;
            do {
                cv = System.in.read();
            } while (keys.indexOf(cv) < 0);

            char c = (char) cv;

            // System.out.println("c " + c + " " + cv);

            if (c == 'd') {
                done = true;
            }

            if (c == 'f') {
                session.feedback(DynamicPlaylistSession.FeedbackType.favorite_song, "last");
            }

            if (c == 's') {
                session.feedback(DynamicPlaylistSession.FeedbackType.skip_song, "last");
            }

            if (c == 'n') {
                Playlist playlist = session.next();

                for (Song song : playlist.getSongs()) {
                    System.out.println(song.getTitle());
                    System.out.println(song.getArtistName());
                    System.out.printf("Dance: %f\n", song.getDanceability());
                    System.out.printf("Energy: %f\n", song.getEnergy());
                    System.out.printf("Tempo: %f\n", song.getTempo());
                    lastSong = song;
                }
            }

            if (c == '+') {
                if (lastSong != null) {
                    DynamicPlaylistSteerParams steerParams = new DynamicPlaylistSteerParams();
                    steerParams.addTargetValue(DynamicPlaylistSteerParams.SteeringParameter.tempo, (float) lastSong.getTempo() * 1.2f);
                    System.out.println("steer " + steerParams);
                    session.steer(steerParams);
                }
            }

            if (c == '-') {
                if (lastSong != null) {
                    DynamicPlaylistSteerParams steerParams = new DynamicPlaylistSteerParams();
                    steerParams.addTargetValue(DynamicPlaylistSteerParams.SteeringParameter.tempo, (float) lastSong.getTempo() * .8f);
                    System.out.println("steer " + steerParams);

                    session.steer(steerParams);
                }
            }
        }
    }
View Full Code Here

                }
            }

            if (c == '+') {
                if (lastSong != null) {
                    DynamicPlaylistSteerParams steerParams = new DynamicPlaylistSteerParams();
                    steerParams.addTargetValue(DynamicPlaylistSteerParams.SteeringParameter.tempo, (float) lastSong.getTempo() * 1.2f);
                    System.out.println("steer " + steerParams);
                    session.steer(steerParams);
                }
            }

            if (c == '-') {
                if (lastSong != null) {
                    DynamicPlaylistSteerParams steerParams = new DynamicPlaylistSteerParams();
                    steerParams.addTargetValue(DynamicPlaylistSteerParams.SteeringParameter.tempo, (float) lastSong.getTempo() * .8f);
                    System.out.println("steer " + steerParams);

                    session.steer(steerParams);
                }
            }
View Full Code Here

* @author plamere
*/
public class ChristmasPlaylist {
   
        public static void main(String[] args) throws EchoNestException {
        EchoNestAPI en = new EchoNestAPI();

        PlaylistParams params = new PlaylistParams();
        params.setType(PlaylistParams.PlaylistType.ARTIST_RADIO);
        params.addArtist("Bing Crosby");
        params.addSongType(SongType.christmas, Song.SongTypeFlag.True);
        Playlist playlist = en.createStaticPlaylist(params);
        for (Song song : playlist.getSongs()) {
            System.out.println(song.getTitle() + " by " + song.getArtistName());
        }
    }
View Full Code Here

* @author plamere
*/
public class DynamicPlaylistExample {

    public static void main(String[] args) throws EchoNestException, IOException {
        EchoNestAPI en = new EchoNestAPI();
        Song lastSong = null;
        en.setTraceSends(false);

        DynamicPlaylistParams params = new DynamicPlaylistParams();
        params.setType(PlaylistParams.PlaylistType.GENRE_RADIO);
        params.addGenre("dance pop");
        params.setMinEnergy(.6f);
        params.setMinDanceability(.6f);
        params.includeAudioSummary();
        DynamicPlaylistSession session = en.createDynamicPlaylist(params);


        boolean done = false;
        while (!done) {
            String keys = "nsfd+-";
View Full Code Here

*
* @author plamere
*/
public class StaticPlaylistExample {
    public static void main(String[] args) throws EchoNestException {
        EchoNestAPI en = new EchoNestAPI();

        // play fast songs by metal bands

        PlaylistParams params = new PlaylistParams();
        params.setType(PlaylistParams.PlaylistType.GENRE_RADIO);
        params.addGenre("metal");
        params.setMinTempo(150);
        params.setResults(10);
        params.includeAudioSummary();
        Playlist playlist = en.createStaticPlaylist(params);

        for (Song song : playlist.getSongs()) {
            System.out.println(song.toString());
        }
    }
View Full Code Here

* @author plamere
*/
public class TrackAnalysisExample {

    public static void main(String[] args) throws EchoNestException {
        EchoNestAPI en = new EchoNestAPI();

        String path = "music/dizzy.mp3";

        if (args.length > 2) {
            path = args[1];
        }

        File file = new File(path);

        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());
View Full Code Here

    private EchoNestAPI en;
    private static boolean trace = false;

    public ArtistExamples() throws EchoNestException {
        en = new EchoNestAPI();
        en.setTraceSends(trace);
        en.setTraceRecvs(trace);
    }
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.