How can I repeatedly play a sound sample, allowing the next loop to overlap the previous
<p>Not sure if this isn't a dupe, but the posts I found so far didn't solve my issue.</p>
<hr />
<p>A while ago, I wrote a (music) <a href="https://askubuntu.com/a/814889/72216">metronome for Ubuntu</a>. The metronome is written in <code>python3/Gtk</code></p>
<p>To repeatedly play the metronome- tick (a recorded sound sample), I used <code>subprocess.Popen()</code> to play the sound, using <code>ogg123</code> as a cli tool:</p>
<pre><code>subprocess.Popen([&quot;ogg123&quot;, soundfile])
</code></pre>
<p>This works fine, I can easily run up to 240 beats per minute.</p>
<h3>On WIndows</h3>
<p>I decided to rewrite the project on Windows (<code>python3/tkinter/ttk</code>). I am having a hard time however to play the sound, repeating the beat sample in higher tempi. The next beat simply won't start while the previous one (appearantly) hasn't finished yet, playing the beat sample.</p>
<p>Is there a way, in <code>python3</code> on Windows, I can start playing the next beat while the sample is still playing?</p>
<p>Currently, I am using <code>winsound</code>:</p>
<pre><code>winsound.Playsound()
</code></pre>
<p>Running this in a loop has, as mentioned issues.</p>