![]() Here's the link for what I mentioned above. And the original code was working earlier pretty much alright. One of them was about using headphones but I don't want to restrict the sound play to headphones and similar devices only. I tried searching google for answers but there wasn't any relevant one. I want to play music with Pygame but the current error stops the program on start. This one seems to work on both Windows and Linux (from this question):def beep(): print('\a') beep() In Windows, can put at the end: import winsound winsound. Finally, you have to wait for the file to play. My python version is 3.10.5 and the Pygame version is 2.1.2. This Python module provides bindings for the PortAudio library and a few convenience functions to play and record NumPy arrays containing audio signals. Invoke play () to start playing the file. Pygame.error: WASAPI can't initialize audio client: It worked a few times just fine but later on, I started getting the following error in my terminal : Traceback (most recent call last):įile "c:\Users\Path\To\File", line 7, in Step 4: Click on the EDIT SETTING button and add in the Redirect URIs as follow. Now, Save your Client Id, Client Secret, this will be used later in our program. ![]() I first initialized the mixer(a pygame module used to play audio) by the following command : ()Īnd then I played some sounds using the music.load and ay commands of mixer module. Step 1: Create an account or log in to your Spotify Developers account here. ![]() I was developing a simple game with Pygame and wanted to play some sound file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |