playsound

Visual C++ or C play sounds

痞子三分冷 提交于 2021-02-08 09:01:25
问题 I'm developping an easy game written in C (Visual C++) and I want to know if there is a way to play sounds, thanks (I'm using Visual Studio) 回答1: Take a look at the PlaySound() function. If you call PlaySound() with the SND_ASYNC flag, the function returns immediately after beginning the sound. For example: #include <windows.h> #include <mmsystem.h> PlaySound(L"test.wav", NULL, SND_ASYNC | SND_FILENAME); You'll also have to add Winmm.lib in your project settings. Here's a quick example that

How to play different sound consecutively and asynchronously in python?

房东的猫 提交于 2021-01-29 12:08:58
问题 To be specific, I need to play sound in a while loop which is fast to execute. And the audio needs to be played separately. I've tried various functions/libraries: playsound, winsound, vlc. But none of them meet my demand. Either the sounds are overlapped, or I need to wait for the sound to finish to continue the next line of code, which blocks the whole process, making the program running with unbearable lags. Matters in playsound, winsound, vlc: playsound: has block option but will block

“A problem occurred in initializing MCI” playsound issues

こ雲淡風輕ζ 提交于 2021-01-27 11:50:23
问题 I'm trying to use playsound to play a file within the folder of my code, however very time I run my code it seems it is able to call the file however I always recieve this output: playsound.PlaysoundException: Error 277 for command: open "para.mp3" alias playsound_0.9208788744295284 A problem occurred in initializing MCI. The code that is run is just the use of the playsound function: from playsound import playsound playsound("01. Humongous.mp3") I'm unsure if this is just an issue with my

“A problem occurred in initializing MCI” playsound issues

淺唱寂寞╮ 提交于 2021-01-27 11:43:06
问题 I'm trying to use playsound to play a file within the folder of my code, however very time I run my code it seems it is able to call the file however I always recieve this output: playsound.PlaysoundException: Error 277 for command: open "para.mp3" alias playsound_0.9208788744295284 A problem occurred in initializing MCI. The code that is run is just the use of the playsound function: from playsound import playsound playsound("01. Humongous.mp3") I'm unsure if this is just an issue with my