Beep() and/or windows error sounds won't play - c++

Beep() stopped working, as in like it won't actually play the sound. I can't hear anything. Also error messages when compiling in VS (or error messages in general) does not play a sound.
This started happening yesterday, and I haven't changed anything. Every other sound on the computer works.
Anyone knows how the hell I can fix this? The default sound device is my headset as per usual, and no sound device is muted etc.
Edit: Also, it does not matter if I switch default sound device to something else. Every other sound keeps playing, but Beep/error messages refuses to play.
Edit2: Heck, even other windows sounds are working, even "start as admin" sound works. I have absolutely no clue what this is.
Thanks

Related

GStreamer Tutorial 1 - hear sound but no video

I'm continuing my journey through GStreamer and am stuck once again. I'm running the first tutorial and can hear sound but no video.
The error that I'm seeing is:
gldisplay gstgldisplay_cocoa.m:175:gst_gl_display_cocoa_setup_nsapp: Custom NSApp initialization failed
Am I missing a plugin or some required library here? I'm on an M1 Mac.
I should note, that via the command line everything works just fine.
gst-launch-1.0 playbin uri="file:///Users/vukasin/Downloads/sintel_trailer-480p.webm"
Maybe this is OpenGL related? I'm guessing its trying, and failing to open the video.
I just figured out what was going on with this error after spending hours thinking my system was not setup correctly. This issue is that a GMainLoop must be ran for the windowing to work correctly from the main thread. Interesting enough the tutorial 12 does it correctly and does the same exact thing. https://gstreamer.freedesktop.org/documentation/tutorials/basic/streaming.html?gi-language=c

How to play two or more sounds at the same time

I'm quite new to programming, I'm in my first year of my programming; CS1B.
I'm making a text adventure game in Visual Studio 2015, I want to use two sounds, like music in the background and a sound effect.
But whenever I try to do so, the first sound stops when the second sound starts. I'm using the PlaySound() function to do my sounds. I know about FMOD and DirectSound but I don't really know how to set it up.
I tried looking through how to do this, but the stuff I find is really hard for me to follow. Any help will be good. Thanks.
You can separate your sounds into SFX and music (which uses the music system). This way, you can control your background music separately (as well as make use of their music-specific features) from your sound effect events.
In general, you need to have a separate event/sound instance for each of the sound you are playing. If you only have one, it could get 'stolen' and this might be the most possible reason for your problem. It could also be because of your channels.
I am not sure if you are using FMOD Studio or FMOD Designer/FMOD Ex, though, so it really depends on which one you are using. In any case, if you are just starting, I recommend reading up on the FMOD Event System - Best Practices For Programmers
documentation which you can get from the Internet, as well as the FMOD Ex Programmer's API documentation (you will have to have an account to download this, but it's worth it.)
Good luck.
PlaySound only has a single 'voice' to work with, so it can't play more than one sound at a time.
To play more than one sound at a time requires a real-time mixer, so you need to use something else: XAudio2, FMOD, Wwise, MSS, OpenAL, etc.
DirectSound is deprecated and hasn't been updated since 2000. It still exists for BackCompat but has a number of restrictions and other subtle legacy behaviors. The only reason anyone should still be using DirectSound at all is if they are targeting Windows XP.
If you are using C++, you should look at DirectX Tool Kit for Audio which is a simple C++ wrapper for XAudio2.
I would guess simple multithreading would do:
#include <thread>
...
thread playsound(&playsound, this, <other params>);
playsound.detach();
thread othersound(&playsound, this, <other params>);
othersound.detach();
Good luck

Mute all but my application

I made little sound generator in C# 4.0 using DirectSound.
I would like to mute all other sounds. I want only my application to be able to emit sounds.
How to do it?
I know how to pInvoke so you can give me unmanaged code.
Properly designed programs either stop playing back sound when their main window becomes deactivated. Or use IDirectSound::SetCooperativeLevel() so they play nice with other programs that want to be heard.
You are asking how to make a improperly designed program behave nicely. With a bit of a hint that you don't contemplate being nice yourself. Teaching that uncooperative program a lesson is simple, run its uninstaller. Avoid being the victim of that same advice.

Forced logout crash with Qt & Opengl

I can't find any documentation on this issue so I figured it was time for a question:
We are writing an application that uses Qt and Opengl with some help from a homebrew singleton class. We have had good luck with it so far but I've just recently run into an amusing situation where if I run the program on my Ubuntu machine it will force a logout.
We do nothing to the machine in terms of user modification. I have a feeling it has something to do with the way we are initializing things, possibly with our timer.
I was curious if anyone had any small insight they might be able to give. Is this a known issue within Qt or Ubuntu?
Note: I would give more information on the program but its very large and I only have a hint as to where to start.
Sounds like a driver or X11 bug that causes a server crash. By definition a client must not be able to crash the X server. However it seems you're experiencing exactly that. There's probably nothing wrong on your side.
What to do: Report the problem to the developers of Xorg and Mesa. Provide a test case, ideally in source code form (try to reduce your programm to the most minimal version that still causes the crash).

Playing sounds over the microphone in c++

I am making a program in C++ for Windows XP that requires sound to be played so that any program that is currently recording the microphone can hear it, but it will not come out of the speakers. There seems to be no "real" way of doing it, but it is possible to go into "sndvol32 -R" and set the Wave out mix or similar as the current input device. Then you can turn the master volume to 0, play the sound, turn it back up, and reset the input device to the microphone. Is there a way of doing this transparently, or setting the current input device using functions, so that you dont have to see sndvol32 pop up?
Thanks
Doing this would require a complicated kernel-level driver.
Fortunately for you, someone has already done this (it's not free, but it's a fantastic program).