use of se.michaelthelin.spotify.model_objects.miscellaneous.AudioAnalysis in project spotify-web-api-java by spotify-web-api-java.
the class GetAudioAnalysisForTrackExample method getAudioAnalysisForTrack_Async.
public static void getAudioAnalysisForTrack_Async() {
try {
final CompletableFuture<AudioAnalysis> audioAnalysisFuture = getAudioAnalysisForTrackRequest.executeAsync();
// Thread free to do other tasks...
// Example Only. Never block in production code.
final AudioAnalysis audioAnalysis = audioAnalysisFuture.join();
System.out.println("Track duration: " + audioAnalysis.getTrack().getDuration());
} catch (CompletionException e) {
System.out.println("Error: " + e.getCause().getMessage());
} catch (CancellationException e) {
System.out.println("Async operation cancelled.");
}
}
use of se.michaelthelin.spotify.model_objects.miscellaneous.AudioAnalysis in project spotify-web-api-java by spotify-web-api-java.
the class GetAudioAnalysisForTrackExample method getAudioAnalysisForTrack_Sync.
public static void getAudioAnalysisForTrack_Sync() {
try {
final AudioAnalysis audioAnalysis = getAudioAnalysisForTrackRequest.execute();
System.out.println("Track duration: " + audioAnalysis.getTrack().getDuration());
} catch (IOException | SpotifyWebApiException | ParseException e) {
System.out.println("Error: " + e.getMessage());
}
}
Aggregations