title: Python, pydub splitting an audio file
body: <p>Hi I am using pydub to split an audio file, giving the ranges to take segments from the original.</p>
  
  <p>What I have is:</p>
  
  <pre><code>from pydub import AudioSegment
  
  sound_file = AudioSegment.from_mp3("C:\\audio file.mp3")
  
  # milliseconds in the sound track
  ranges = [(30000,40000),(50000,60000),(80000,90000),(100000,110000),(150000,180000)] 
  
  for x, y in ranges:
      new_file = sound_file[x : y]
      new_file.export("C:\\" + str(x) + "-" + str(y) +".mp3", format="mp3")
  </code></pre>
  
  <p>It works well for the first 3 new files. However not the rest - it doesn’t split accordingly.</p>
  
  <p>Does the problem lie in the way I give the range?</p>
  
  <p>Thank you.</p>
  
  <p><strong>Add-on:</strong></p>
  
  <p>When it's made simple - for example</p>
  
  <pre><code>sound_file[150000:180000]
  </code></pre>
  
  <p>and export it to a mp3 file. it works but only cuts 50000:80000 part. it seems not reading a correct range.</p>