public Subtitle getSubtitle ( int trackID ) throws MusixMatchException { Subtitle subtitle = null ; SubtitleGetMessage message = null ; Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( Constants . API_KEY , apiKey ) ; params . put ( Constants . TRACK_ID , new String ( "" + trackID ) ) ; String response = null ; response = MusixMatchRequest . sendRequest ( Helper . getURLString ( Methods . TRACK_SUBTITLE_GET , params ) ) ; Gson gson = new Gson ( ) ; try { message = gson . fromJson ( response , SubtitleGetMessage . class ) ; } catch ( JsonParseException jpe ) { jpe . printStackTrace ( ) ; handleErrorResponse ( response ) ; } subtitle = message . getContainer ( ) . getBody ( ) . getSubtitle ( ) ; return subtitle ; }
Get Subtitle for the specific trackID .