def get_starttime(length, nseconds, padding):
 maximum = ((length - padding) - nseconds)
 if (padding > maximum):
  return 0
 return random.randint(padding, maximum)

def get_starttime ( length , nseconds , padding ) : maximum = ( ( length - padding ) - nseconds ) if ( padding > maximum ) : return 0 return random . randint ( padding , maximum )
length is total audio length in seconds nseconds is amount of time to sample in seconds padding is off-limits seconds at beginning and ending .