def generate_srt_from_sjson(sjson_subs, speed):
 output = ''
 equal_len = (len(sjson_subs['start']) == len(sjson_subs['end']) == len(sjson_subs['text']))
 if (not equal_len):
  return output
 sjson_speed_1 = generate_subs(speed, 1, sjson_subs)
 for i in range(len(sjson_speed_1['start'])):
  item = SubRipItem(index=i, start=SubRipTime(milliseconds=sjson_speed_1['start'][i]), end=SubRipTime(milliseconds=sjson_speed_1['end'][i]), text=sjson_speed_1['text'][i])
  output += unicode(item)
  output += '\n'
 return output

def generate_srt_from_sjson ( sjson_subs , speed ) : output = '' equal_len = ( len ( sjson_subs [ 'start' ] ) == len ( sjson_subs [ 'end' ] ) == len ( sjson_subs [ 'text' ] ) ) if ( not equal_len ) : return output sjson_speed_1 = generate_subs ( speed , 1 , sjson_subs ) for i in range ( len ( sjson_speed_1 [ 'start' ] ) ) : item = SubRipItem ( index = i , start = SubRipTime ( milliseconds = sjson_speed_1 [ 'start' ] [ i ] ) , end = SubRipTime ( milliseconds = sjson_speed_1 [ 'end' ] [ i ] ) , text = sjson_speed_1 [ 'text' ] [ i ] ) output += unicode ( item ) output += '\n' return output
generate transcripts with speed = 1 .