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
votes
1 answer

How do I make PlaySound load only some parts of the song C++

I have a 424 mb wav file, which I want to play, but it takes a lot of time to load, and it uses 425.6 mb of ram. Way too much ram for a dos format program. I want to load only a part of the song, then when it's almost at the final, load the second…
-1
votes
1 answer

Why can't I play sound when a button is pressed?

This is the code I have written but I am to new to understand how to fix this error. Every time I run the app the build is successful, but then when I go to tap on the button/key, it gives me this error. Thread 1: Fatal error: Unexpectedly found nil…
-1
votes
1 answer

Playsound not playing sound

Here is what I tried #include #include #pragma comment( lib, "Winmm.lib" ) using namespace std; int main() { PlaySound(L"C:\Users\Lol\Downloads\Music\Undertale OST - Hotel Extended.wav", 0, SND_FILENAME); return…
LuckyFire
  • 41
  • 7
-1
votes
1 answer

Simple Sound Player

I am trying to make a simple app that plays a sound when pressing a specific number but whatever I enter it plays the first song for some weird reason. #include #include #include "MMsystem.h" void main(void){ …
Adam.A.T.
  • 7
  • 1
-1
votes
2 answers

PlaySound works in Visual Studio but not in standalone exe

I am trying to play a wav file in C++ using Visual Studio. I put file "my.wav" in my project directory and use the code PlaySound(TEXT("my.wav"), NULL, SND_FILENAME | SND_SYNC); I hit the play button (or F5 or even Ctrl-F5) and it plays the sound…
-2
votes
0 answers

Python Functions execute in wrong order, can someone help me?

FYI i just started learning Python. I intended to take partial screenshot, show the screenshot image, then read it with OCR, then gTTS will play the sound on how to read it. But instead, when i run the program, it will show the previous screenshot…
-2
votes
1 answer

How can I start and stop audio with the same UI button? – Swift

I am making a very simple IOS app. It is a button, and when pressed a long .wav file plays. I would love to be able to press the button again, and the audio would stop playing. I’ve tried many of the solutions here as there are similar questions,…
Greg Funk
  • 1
  • 1
-2
votes
1 answer

Play a sound file in masm32 and to stop the other sound file at the same time

So I am doing a game in assembly language and I am using the PlaySound() function to play a background song. I want to do that after I "die" in the game, another sound file will start playing a sound file, and at the same time will stop the other…
jeff style
  • 61
  • 1
  • 7
-2
votes
1 answer

How to play a sound in VB6 with PlaySound()

How can I use PlaySound() to play a .wav file? I have PlaySound(sound) but I keep getting error "Argument not optional". Also how do I stop playing a sound?
Aaron Hiniker
  • 3,923
  • 6
  • 21
  • 14
-3
votes
2 answers

Can I send a stream from blob data in a database to PlaySound (MMSystem) rather than supplying a file name?

I need to be able to supply a stand alone system for a medical application that will be distributed free of charge to home users of blood pressure monitors, it is being designed to run off a memory stick and taken to doctors, pharmacists, hospitals,…
OutOfTime
  • 1
  • 5
-3
votes
1 answer

JavaScript pause sound if false

I have an async function that gets an array of objects, I set a soundOn to true if: soundOn = content.some(ele => ele.order_status === 'processing'); It works partly, e.g. plays sound when above is true - however continues to play even if soundOn…
Abu Nooh
  • 846
  • 4
  • 12
  • 42
-3
votes
1 answer

Using PlaySound() in MASM, need a method to help run this in the background without the code waiting for the entire .wav sound file to finish

Using this code (mostly just added the irvine32.inc to the github code here: https://gist.github.com/michaellindahl/7782978 TITLE MASM PlaySound (PlaySoundExample.asm) includelib winmm.lib INCLUDE Irvine32.inc INCLUDE…
-3
votes
1 answer

PlaySound() with resource file not working

I'm kinda confused about how is the use of PlaySound() with a resource file, 'cause, reading here and testing all the things, I can't accomplish get the wav file sounds in a console prompt u_u. So, if you can help me, I'll be very grateful.…
Fuad Nazal
  • 1
  • 1
  • 1
1 2 3
13
14