I'm trying to play music from within a DLL. However, whenever I try this, the PlaySound function does nothing.  I've already attempted having the wav file in a resource and I know that the code works as when I compile the DLLMain as a normal main, it plays the music with no problems. The DLLMain code looks like this:  if (ul_reason_for_call == DLL_PROCESS_ATTACH) {     PlaySoundA("C:\\Sound.wav", NULL, SND_FILENAME); }  return TRUE;   The strange thing is, I can see that the song is in the program's memory; the memory usage of it goes up to what it should do when it plays a song, but it has no sound. Also, the same code compiled to an exe works perfectly; I can't figure out what's going wrong.  UPDATE: It turns out this is because you can't execute lots of things in DLLMain - are there any ways around this?
123777
What is the difference between the three functions and when to use them??
112661
Is it possible to force the C# compiler to pull all the referenced calls out of the framework and pack them into dlls or even a single executable?   I like writing quick 'one-off' applications with C#, however I don't want to have to install the whole framework on the target machine once it's ready to go.
12342
I have a dell studio 1749. I just installed 12.04 on a dual boot with windows 7 (The stereo sound and headphones work perfectly when booted into windows, sound turned up before booting into Ubuntu). The stereo sound seems to be working fine. The headphones, not so much.   My computer has two headphone jacks. When I put my working headphones into the first jack, the stereo sound is muted but there is no sound in the headphones. When I put my headphones into the second jack, the stereo sound is still there and no sound comes out of the headphones. Two different problems?  I first tried the sound troubleshooting found . There seemed to be no problems. However, I'm not positive that my sound cards were on the list. It was a little convoluted for my noob self. I've tried the commands listed  but there were no changes. I've also brought up the alsamixer. The headphones don't appear to be muted or anything. I don't know how to switch to the second sound card and check that one, though.   Any help would be greatly appreciated!
66654
If you create a class library that uses things from other assemblies, is it possible to embed those other assemblies inside the class library as some kind of resource?  I.e. instead of having MyAssembly.dll, SomeAssembly1.dll and SomeAssembly2.dll sitting on the file system, those other two files get bundled in to MyAssembly.dll and are usable in its code.    I'm also a little confused about why .NET assemblies are .dll files. Didn't this format exist before .NET? Are all .NET assemblies DLLs, but not all DLLs are .NET assemblies? Why do they use the same file format and/or file extension?
8508
I have some music discs, but every time I put it in a jukebox I can't hear it. It says it's playing, my friend (on PS4) says he can hear it, but I don't. All other audio is fine, I can hear the game audio fine, even if I have a world that's only me: it still doesn't produce jukebox sounds. It visually shows that it's playing (the notes come out of the jukebox) but there is no music. I play on Pocket Edition. Can someone help me resolve this issue?
107058
In the past Ive always brought dedicated sound cards for my computers, however these days most motherboards have some sort of audio support built in, in fact many even are capable of surround sound, and a large amount of the audio processing can be done completely in software anyway (eg as I understand, XAudio2, which is set to replace DirectSound does all processing in software, just using the hardware to actually send the final audio data to the speakers).  So considering those things is there actually any point to fitting a dedicated sound card in modern computers?  EDIT: So does the improved quality of dedicated audio hardware apply to software based audio solutions which seem to be becoming more popular?
120337
Does anyone know how to programmatically capture the sound that is being played (that is, everything that is coming from the sound card, not the input devices such as a microphone).
45858
The stream does not play in Rhythmbox nor totem. It played fine before the upgrade; it looks like a regression from . The streams play in mplayer and play fine when downloaded with wget and then opened in totem. I suspect there is either a bug in gstreamer, or I am missing some component of gstreamer, somehow.   Is this a known bug: if so where can I help debug it? What part, package or addong for gstreamer manages streaming of mp3? Is rhythbox using gstreamer at all? If not, I am probably looking in the wrong direction.
115885
If I plug in speakers or headphones to my PC I get no audio out from either. In my sound setting, the default is set to the speakers and the little icon with the green bars moves up and down with the sound as if it is working.  I have done a clean reinstall of Windows 7 and still have the same problem. Device Manager shows all drivers are good. I've reinstalled them just in case and same issue. I've been using the motherboard CD to install the drivers. I tried to uninstall it and allowed Windows 7 to find the driver automatically and it did but I'm still having the same issue.  What are my options? Or what do you recommended I do?
89051
I am building on C++ dll, by writing code in C#.  I get an error, saying      LoaderLock was detected Message:   Attempting managed execution inside OS   Loader lock. Do not attempt to run   managed code inside a DllMain or image   initialization function since doing so   can cause the application to hang.   I tried seraching what this error exactly means, but I am drawing pointless articles, mostly saying that it's just a warning, and I should switch that off in Visual Studio. The other solutions seem to be due to ITunes, or this problem occurring when programming with DirectX. My problem is connected to neither.  Can anybody explain, what this actually means?
85226
I have a dll that was written in c++, I need to use this dll in my c# code. After searching I found that using P/Invoke would give me access to the function I need, but these functions are defined with in a class and use non-static private member variables. So I need to be able to create an instance of this class to properly use the functions. How can I gain access to this class so that I can create an instance? I have been unable to find a way to do this.   I guess I should note that the c++ dll is not my code.
8958
Is it possible to embed a pre-existing DLL into a compiled C# executable (so that you only have one file to distribute)? If it is possible, how would one go about doing it?  Normally, I'm cool with just leaving the DLLs outside and having the setup program handle everything, but there have been a couple of people at work who have asked me this and I honestly don't know.
119089
If music isn't loud enough, how do I get the best quality (even if the difference is in fact so small it's negligible)?   By making the music louder in my music player, game or other sound-producing software program? By raising the volume at the operating system level (for instance, by clicking the speaker icon in the Windows notification area and turning the volume up)? By turning the volume up on the amplifier or speakers that are attached to your computer, and thus changing the volume on the hardware?   Does programs vs. OS matter? Does software vs. hardware matter?
23986
I need an OpenSource API in Java, which can encode *.wav and *.au formats to MP3 and vice-versa.   I have evaluated Java Sound API and , but they do not meet my requirements and are not stable, respectively. Please suggest one that is free and platform independent.
65620
How can I download or turn on my stereo mix feature in Windows 7? In music chat rooms I can't play music. When I had Windows XP, I had the stereo mix option in Audio settings. I can't seem to find it here.
68696
I'm learning C#, so I made a little C# program that says Hello, World!, then compiled it with mono-csc and ran it with mono:  $ mono-csc Hello.cs $ mono Hello.exe Hello, World!   I noticed that when I hit TAB in bash, Hello.exe was marked executable. Indeed, it runs by just a shell loading the filename!   Hello.exe is not an ELF file with a funny file extension:  $ readelf -a Hello.exe readelf: Error: Not an ELF file - it has the wrong magic bytes at the start $ xxd Hello.exe | head -n1 00000000: 4d5a 9000 0300 0000 0400 0000 ffff 0000  MZ..............   MZ means it's a Microsoft Windows statically linked executable. Drop it onto a Windows box, and it will (should) run.  I have wine installed, but wine, being a compatibility layer for Windows apps, takes about 5x as long to run Hello.exe as mono and executing it directly do, so it's not wine that runs it.  I'm assuming there's some mono kernel module installed with mono that intercepts the exec syscall/s, or catches binaries that begin with 4D 5A, but lsmod | grep mono and friends return an error.   What's going on here, and how does the kernel know that this executable is special?    Just for proof it's not my shell working magic, I used  (aka sh) to run it and it still runs natively.    Here's the program in full, since a commenter was curious:  using System;  class Hello {   /// &lt;summary&gt;   ///   The main entry point for the application   /// &lt;/summary&gt;   [STAThread]   public static void Main(string[] args) {     System.Console.Write("Hello, World!\n");   } }
31417
Given the following C function in a DLL:  char * GetDir(char* path );   How would you P/Invoke this function into C# and marshal the char * properly. .NET seems to know how to do LPCTSTR but when I can't figure out any marshaling that doesn't cause a NotSupportedException to fire when calling this function.