Replit audio help(program pause)

When I play sound using the
it pauses the entire program.
the repl link is here:
the sound is so short that you may not notice it pausing but it does.
Is there a way it could start the sound and keep the program running while the sound plays?

Hey, @CoolKid111 !

Can you please provide a link to the repl? This way it is easier for staff and members of the community to help you!

Also see this guide on how to share your code:

I have updated the Topic

I haven’t used that before, but my guess is that it pauses until the audio is done playing. In this case, you’d probably have to use threads or coroutines.

Here’s an example Python script that runs two functions simultaneously:

from threading import Thread

def func1():
    print("First function")

def func2():
    print("Second function that runs separately from the first, but at the same time as it")

if __name__ == '__main__':
    Thread(target = func1).start()
    Thread(target = func2).start()
1 Like

I will try that, thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.