Play multiple sounds at the same time in python
<p>I have been looking into a way to play sounds from a list of samples, and I found some modules that can do this.</p>

<p>I am using <strong>AudioLazy</strong> module to play the sound using the following script:</p>

<pre><code>from audiolazy import AudioIO

sound = Somelist
with AudioIO(True) as player:
  player.play(sound, rate=44100)
</code></pre>

<p>The problem with this code is that it stop the whole application till the sound stop playing and I can't play multiple sound at the same time.</p>

<p>My program is interactive so what I want is to be able to play multiple sound at the same time,So for instance I can run this script which will play a 5 second sound then at the second 2 I can play a 5 second sound again.</p>

<p>And I don't want the whole program to stop till the sound finish playing.</p>

<p>Using multiple threads will solve your problem :</p>

<pre><code>import threading
from audiolazy import AudioIO

sound = Somelist
with AudioIO(True) as player:
  t = threading.Thread(target=player.play, args=(sound,), kwargs={'rate':44100})
  t.start()
</code></pre>

python audio interactive