Package com.echonest.api.v4.util

Examples of com.echonest.api.v4.util.Shell


* @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

public class SearchSongsExample {

    private EchoNestAPI en;

    public SearchSongsExample() throws EchoNestException {
        en = new EchoNestAPI();
        en.setTraceSends(true);
        en.setTraceRecvs(false);
    }
View Full Code Here

import java.util.List;

public class SimlarArtists {

    public static void main(String[] args) throws EchoNestException {
        EchoNestAPI echoNest = new EchoNestAPI();
        echoNest.setTraceSends(true);
        List<Artist> artists = echoNest.searchArtists("Weezer");

        if (artists.size() > 0) {
            Artist weezer = artists.get(0);
            System.out.println("Similar artists for " + weezer.getName());
            for (Artist simArtist : weezer.getSimilar(10)) {
View Full Code Here

* @author plamere
*/
public class OldestTopArtist {

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

        List<Artist> artists = en.topHotArtists(100);

        Collections.sort(artists,
                new Comparator<Artist>() {
                    @Override
                    public int compare(Artist t1, Artist t2) {
View Full Code Here

* @author plamere
*/
public class TopHotttestSongs {

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

        SongParams p = new SongParams();
        p.setResults(100);
        p.sortBy("song_hotttnesss", false);
        List<Song> songs = en.searchSongs(p);


        String lastTitle = "";
        for (Song song : songs) {
            if (!lastTitle.toLowerCase().equals(song.getTitle().toLowerCase())) {
View Full Code Here

* @author plamere
*/
public class RosettaPlaylistExample {
   
    public static void main(String[] args) throws EchoNestException {
        EchoNestAPI en = new EchoNestAPI();
        PlaylistParams params = new PlaylistParams();
        params.addIDSpace("spotify-WW");
        params.setType(PlaylistParams.PlaylistType.GENRE_RADIO);
        params.addGenre("dance pop");
        params.includeTracks();
        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

* @author plamere
*/
public class BasicPlaylistExample {

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

        BasicPlaylistParams params = new BasicPlaylistParams();
        params.addArtist("Weezer");
        params.setType(BasicPlaylistParams.PlaylistType.ARTIST_RADIO);
        params.setResults(10);
        Playlist playlist = en.createBasicPlaylist(params);

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

TOP

Related Classes of com.echonest.api.v4.util.Shell

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.