docs: def compose(segments, out='out.mp3', padding=0, crossfade=0, layer=False):
      '''Stiches together a new audiotrack'''
  
      files = {}
  
      working_segments = []
  
      audio = AudioSegment.empty()
  
      if layer:
          total_time = max([s['end'] - s['start'] for s in segments]) * 1000
          audio = AudioSegment.silent(duration=total_time)
  
      for i, s in enumerate(segments):
          try:
              start = s['start'] * 1000
              end = s['end'] * 1000
              f = s['file'].replace('.transcription.txt', '')
              if f not in files:
                  if f.endswith('.wav'):
                      files[f] = AudioSegment.from_wav(f)
                  elif f.endswith('.mp3'):
                      files[f] = AudioSegment.from_mp3(f)
  
              segment = files[f][start:end]
  
              print(start, end, f)
  
              if layer:
                  audio = audio.overlay(segment, times=1)
              else:
                  if i > 0:
                      audio = audio.append(segment, crossfade=crossfade)
                  else:
                      audio = audio + segment
  
              if padding > 0:
                  audio = audio + AudioSegment.silent(duration=padding)
  
              s['duration'] = len(segment)
              working_segments.append(s)
          except:
              continue
  
      audio.export(out, format=os.path.splitext(out)[1].replace('.', ''))
      return working_segments