Questions tagged [playsound]

The PlaySound function plays a sound specified by the given file name, resource, or system event. (A system event may be associated with a sound in the registry or in the WIN.INI file.)

The PlaySound function plays a sound specified by the given file name, resource, or system event. (A system event may be associated with a sound in the registry or in the WIN.INI file.)

Parameters

pszSound: A string that specifies the sound to play. The maximum length, including the null terminator, is 256 characters. If this parameter is NULL, any currently playing waveform sound is stopped. To stop a non-waveform sound, specify SND_PURGE in the fdwSound parameter.

Three flags in fdwSound (SND_ALIAS, SND_FILENAME, and SND_RESOURCE) determine whether the name is interpreted as an alias for a system event, a file name, or a resource identifier. If none of these flags are specified, PlaySound searches the registry or the WIN.INI file for an association with the specified sound name. If an association is found, the sound event is played. If no association is found in the registry, the name is interpreted as a file name.

hmod: Handle to the executable file that contains the resource to be loaded. This parameter must be NULL unless SND_RESOURCE is specified in fdwSound.

fdwSound: Flags for playing the sound. The following values are defined.

209 questions
1
vote
1 answer

Playsound TypeError: can only concatenate str (not "bytes") to str

I can't get playsound to work, it instead gives me TypeError: can only concatenate str (not "bytes") to str. Please bear with me here, I'm a first timer here and not very good with python. The error: Exception has occurred: TypeError can only…
1
vote
0 answers

How to repeat an audio inside a function in Python with Tkinter?

I need to repeat a sound every time I click at button, but it just play the audio one single time. There is the code: from playsound import playsound from gtts import gTTS from tkinter import * window = Tk() window.title("Text to…
1
vote
1 answer

Android SDK. audioManager. setStreamVolume currunt int value

I already used below code for sound mute in my audio player. ((Activity)mActivity).getAudioManager().setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0); Now I need to know how to set unmute and set before volume level.
1
vote
1 answer

How to play a sound 1 time

The conditional operator checks "if answer_code == NumberX" then the code starts the sound, but due to the fact that it's all in the loop, the sound is played every frame. How do I make the sound play 1 time? while run: timer.tick(fps) #…
Neytron
  • 23
  • 2
1
vote
2 answers

Playing a sound with playsound in WSL gives a long list error

I try to play a simple sound in my WSL Debian but I cannot fix a long list of errors. I don't know what to do more... Searching different advise on the net, I'have installed pip install playsound apt install libcairo2-dev libgirepository1.0-dev…
nguxx
  • 23
  • 5
1
vote
2 answers

play sound in xylophone project

I try to make a Xylophone. I added my Sound file by dragging the file into my XCode project and i made sure 'Copy items if needed' is checked. I wrote the code. I connected 7 buttons to the keyPressed function. I set the names of the sound files and…
1
vote
1 answer

Azure Virtual Machine Microphone and Speaker

How we can enable the microphone on the Azure virtual machine while keep hearing the sound of the system as well?? When I change the RDP setting to "play on this computer", I can hear the sound of system but not able to use a microphone and when I…
Ahmed Ali
  • 7
  • 2
1
vote
1 answer

WinAPI: How to make sound effect keep up with each mouse clicking

Ensure that sound was played after each clicking the mouse. My idea is to create a thread that runs constantly. #include music ding1("./ding1.wav"); music ding2("./ding2.wav"); void* pmusic(void* a) { while(1) { DWORD…
anti-gravity
  • 122
  • 6
1
vote
1 answer

Sound effects for multiple buttons on a page in WordPress

I have been scouring the internet, trying to find a way to play a short wav file on a button click. I want to put a total of 10 buttons on my homepage that would each play a different short sound. I am building my site in WordPress. It seems like…
1
vote
2 answers

Playing soundfile when hovering over specific object

Can anyone understand what I'm doing wrong? This code returns the error that "songs is not a function".

some text

some text

1
vote
1 answer

Lazarus play music in loop

I've been working on a little tool the past few days and the functionality itself is fine. I wanted to make the tool a little nicer to work with (at least for me) and included a sound-file (called test.wav) which plays one of my favorite songs. The…
AlphaInc.
  • 73
  • 8
1
vote
3 answers

Flutter app - want to play sound oppressed() without it being pressed

I am working on app in which I can get the app play sound when a button is pressed, but I also want to implement a feature that when the user hover the finger over all buttons without releasing (like piano), each button play its sound. How can I do…
Gigili
  • 600
  • 1
  • 7
  • 19
1
vote
1 answer

How to pass in a const char* as an argument to an LPCSTR parameter?

I'd like to use this function to call the the PlaySoundA function, but the sound file I am trying to play does not open. void AudioClass::playAudio(const char* incomingData, const char* filePath) { char buffer[100]; // <- danger, only storage…
1
vote
0 answers

How to play sound on incoming or outgoing calls?

I want to play sound on any incoming or outgoing calls and stop when call disconnected. I've tried some codes and now I'm getting when my phone is ringing and answered and disconnected. But sound is not playing properly. I put the code for playing…
1
vote
2 answers

How do I detect when the sound has finished playing when using PlaySound in Win32 SDK?

I am using the PlaySound function from the Win32 SDK to play a wave sound file. Currently, I have the following line of code: PlaySound(szFile,NULL,SND_FILENAME ); But now I want to know, how I can detect the time when the wave file finished…
fr33m4n
  • 542
  • 2
  • 13
  • 31
1
2
3
13 14