Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 6
    For me, this was not working. I mean, it was playing but no sound. I added time.sleep(5) at the end and that worked. Python 3.6 on Windows 8.1 Commented Nov 22, 2018 at 6:15
  • It doesn't work on fedora with standard ".wav", ".mp3" and ".ogg" (Unable to open file 'filename.format') Commented Nov 17, 2019 at 9:06
  • 3
    @Calvin-Ruiz I just confirmed that I am able to use the above code in FC31 to play MP3 and Ogg files. I think you have a larger problem that likely needs some detailed knowledge of your platform. Commented Nov 19, 2019 at 18:16
  • This doesn't appear to work un ubuntu 20.10 Commented Feb 12, 2021 at 21:15
  • It works fine with win10. The recording needs some time to get to the output so I tried for testing purposes to move the command up on the stack and it worked. Commented Sep 13, 2021 at 21:39