title: How to play two sounds at once using Python?
body: <p>I'm looking to make a loop system (inspired by <a href="https://www.youtube.com/watch?v=_g5NDLKy0NI" rel="nofollow noreferrer">Marc Rebillet</a>, check him out) and am struggling with getting 2 sounds to play over themselves. </p>
  
  <p>I've started out using sounddevice, as it's the first audio module that I found, but I'm not sure if there's a different once that would work better. </p>
  
  <pre><code>import time
  
  def record(duration): # records a few seconds of audio
      print('recording in:')
      print('3')
      time.sleep(1)
      print('2')
      time.sleep(1)
      print('1')
      time.sleep(1)
      print('recording')
      record = sd.rec(int(duration * fs), samplerate=48000, channels=2)
      sd.wait()
      print('done\n\n')
      return record
  
  duration = 3.5  # seconds
  
  recordOne = record(duration)
  recordTwo = record(duration)
  
  while True: # repeats both pieces of audio
      sd.play(recordOne, fs)
      sd.play(recordTwo, fs)
      sd.wait()
  </code></pre>
  
  <p>This code ended up only playing the recordTwo, and doesn't layer them over eachother. Again, I'd like to be able to play multiple sounds at the same time. Thank you for any help!</p>