Showing posts with label bug. Show all posts
Showing posts with label bug. Show all posts

Tuesday, March 11, 2014

Windows Phone–Removing Duplicate Songs and/or Albums

Time for another post that has nothing to do with development…

If you own a Windows Phone, you have probably seen duplicate songs or albums in your music library. This can be a very frustrating bug to deal with and it is difficult to fix. It would be nice if you could simple select a track or album and delete it right from your phone. Unfortunately, Microsoft does not allow us to do that. It would even be great if connecting the phone to your computer and deleting it files in the file browser or via the Windows Phone app would take care of it for you. Well… no. That doesn’t always work. After struggling with this for a little while, I found a solution that worked for me. Hopefully it works for you too if you are in the same boat. Here is what I did to remove the duplicate songs.

-Connect the phone to your computer with the usb cable and open it up in Windows Explorer.

-Locate the Music folder.

-Select View > Show Hidden Files (from the toolbar or ribbon control depending on what os you are running)

-Once you are seeing the hidden files, you should see an Artists folder that contains a file for each artist in your collection. Find the artist that has the duplicate files and erase that file.

-Navigate to that artist’s corresponding music files directory on your phone and delete those files.

-Copy the music files from your music library on your pc back onto your phone. This should re-generate that file you previously deleted under the hidden Artists directory. This is the file that tells your phone what files to display.

That should do it. You can now disconnect your phone and see no more duplicate files (or at least that worked for me).

Good luck!

Wednesday, July 10, 2013

WPF–SoundPlayer Bug

Here is an interesting one. I was using the SoundPlayerAction in WPF to plan a small .wav file when a view was loaded, and I noticed that sometimes I would get a very strange screeching sound while the audio was playing. This did not happen all the time, but it happened enough that it needed to be fixed. The bug was more apparent on certain machines than others. After some digging around, I found out it had to do with the Garbage Collector of all things.  Essentially, the GC automatically decides to start moving the bytes used in the sound file before it’s done playing the file. This causes the annoying screeching sound. So how did I fix this issue? The solution that worked for me was to simply change the build action on my sound files from resource to content. I then had to change all my references to my audio files to use the correct format (from pack://application to pack://siteoforigin) and that took care of the issue. This bug only presents itself when trying to play audio from embedded resources. If playing directly from a file, you should not have the same problem.

Here are the links I found explaining more about the bug and how to get around it.

http://social.msdn.microsoft.com/Forums/vstudio/en-US/9c8bf569-3469-49d8-9f2a-8246ee40477c/soundplayeraction-plays-crazy-noise

http://www.codeproject.com/Articles/13909/SoundPlayer-bug-Calling-unmanaged-APIs

Happy Screech-Free Coding!