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
0
votes
2 answers

How do i design a loop that playsound continously but doesn't block rest of program?

I have a sound byte i want to loop continuously as the user is presented with a set of case statements. So once the while statement which has both the case statements and play sound loop is triggered, I want the sound loop to keep playing while not…
Pardon_me
  • 715
  • 2
  • 8
  • 20
0
votes
1 answer

Using PlaySound to play a wav file

I'm using windows 7 running visual studio 2010 and writing in Cc. Here is a snippet of my code. When the condition is met (temperature is higher than high limit) then I want to play a wav file from my computer. I checked around the forums and I…
Pardon_me
  • 715
  • 2
  • 8
  • 20
0
votes
1 answer

PlaySound() works for 1 sound, is there a function for more?

Tried looking for the answer but all I could find was to add another library like OpenAL and such. (all I use except windows.h is glut) I wrote a multi thread program to check if it is possible that one thread will keep playing the main theme and…
Despairy
  • 13
  • 3
0
votes
2 answers

Play sound with OpenAL

I don't understand how I can play sound with OpenAL library. I write program for VoIP. I'm getting every 10ms sound buffer. size_t len = socket.read_some(boost::asio::buffer(buf),error); buf is boost::array buf; And that I need to do…
Alexander Mashin
  • 693
  • 3
  • 14
  • 34
0
votes
0 answers

PlaySound() played but not hear c++

I use playsound it work ok on my laptop but on my pc it's not working. When sound is playing I check volume scale it go up and down. But I can't hear any sound. Note that my PC Speaker is using normal.
Phat Tran
  • 307
  • 1
  • 3
  • 14
0
votes
1 answer

How to play .wav file from another folder? Done on Visual Studio 2010 c++

I'm doing a project that requires the user to type in the phonetic sounds. For example, th. Then the program will play a wave file that produce th sound. As there are many different wave files for a phonetic sounds, I have decided to group them…
0
votes
1 answer

Play and pause an .wav or .mp3 file on windows

I am working on a console application where i have to deal with multiple sound file with all of same type(.wav or .mp3). I have the option to chose between the two. I can play the sound fine using PlaySound() function but i need some extra…
Hardeep Brah
  • 17
  • 2
  • 8
-1
votes
1 answer

run image and sound same time in python with opencv library and playsound library

from playsound import playsound import cv2 image = cv2.imread("img.png") cv2.imshow("image2", image), playsound("Stan.mp3") cv2.waitKey(0) cv2.destroyAllWindows() I write this program, when I run it, this sound run the sound works well, but image…
-1
votes
1 answer

Error when using "playsound" library with pyinstaller

I'm trying to use pyinstaller to create an executable for my project, but when it hits the "playsound" function, outputs the error below. This only happens with the executable and not the regular code. Error 263 for command: open…
Tom154ce
  • 37
  • 2
-1
votes
1 answer

How to use C++ PlaySound() function with sound from resources?

I'm trying to play the song in simple console executable. However after running the .exe the song doesn't play and the windows notification sound appears instead in loop. The resources are created properly (l am using Codeblocks so l can see them in…
Ключ
  • 11
  • 5
-1
votes
3 answers

Playing sound using Python

Basically I'm trying to write a code that opens a sound file using python, but all I get is this error. using MacOS and Python 3.10. tried many solutions but no luck. This is the code I’ve tried first: from playsound import…
Oughtly
  • 1
  • 2
-1
votes
1 answer

Why can't I use a filename containing a space with playsound in python?

If I use a music file name sample.mp3, it works, but if I use sample one.mp3, it doesn't work. Even if I insert a desktop pathway, it stops working, and if I save the same file in other folders and insert its pathway, it starts working. from…
-1
votes
1 answer

Swift- Why I Can't Play The Sound?

Why this isn't working? I searched to ways of adding sound into a Xcode and I saw so many different ways. I thought I figured it out how the system's working but something is going wrong but I can't see the problem. import AVFoundation var…
ahtctn
  • 15
  • 5
-1
votes
1 answer

Unity Editor freezes when OnTriggerEnter() plays a sound

My Unity Editor Freezes every time the player enters the trigger, I have added a keycode to see if the audio source is causing it I have commented source.Play() out of the OnTriggerEnter and used a debug statement to check for collisions working…
OwenH
  • 1
  • 1
-1
votes
1 answer

Having a Problem playing .WAV files in java

I was creating what I deemed to be a quite simple program that played a .wav file in Java, but the sound is not playing when the program is started. All of my imports seem to be good, and I am not too sure why it is not playing, and I am starting to…
1 2 3
13
14