My program worked earlier this year before Windows 10 put and update and suddenly it doesn't work anymore. I have a separate laptop that didn't get the update and it works perfectly. Can someone please tell me what I need to do to get it to work? Ive tried everything I could think of and nothing works.

                    string[] music = Directory.GetFiles(@"C:\Users\Robert\Documents\C# stuff\Skynet\Skynet\bin\Debug\Music file", "*.mp3");// this is the original path

                    WMPLib.IWMPPlaylist Classicalplaylist = mplayer.playlistCollection.newPlaylist("classicalplaylist");
                    foreach (string file in music)
                    {
                        WMPLib.IWMPMedia media = mplayer.newMedia(file);
                        Classicalplaylist.appendItem(media);
                    }
                    mplayer.currentPlaylist = Classicalplaylist;
HuiCheng commented: i think you Pc audio have program,my windows 11 can start,is you audio have program? +0

What doesn't work exactly?

When I run it on visual studio it runs but music doesn't play. I don't get any error messages. When I use the same program on my other laptop without the windows update it runs perfectly and plays music.

Now that PCs can have more than one audio output your code could function perfectly but play on some sound device that has no speakers. Example: I have a Blue microphone and it oddly has an audio output that if an app was set to use it, no sound at all will be made (except maybe me going "what now?")

Can you give me some examples or a link? I am using visual studio on a windows computer.

commented: Sorry but there are so many versions of Visual Studio. If the above didn't compile, could be a setup issue. +16

I found what the problem was in the program. I put an incorrect path to the songs and once I corrected that mistake it worked like a charm.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.