The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
SoundEffect & Emulator Issues RRS feed

  • Question

  • In Silverlight, I'm noticing when I play short sounds (0.1 to 0.5 seconds in length), sometimes they don't play or sometimes they cut off near the end. Usually there's a bit of crackling during playback as well. I just want to verify if this is an emulator issue and others are experiencing it as well. It's difficult to gauge quality with this problem. My specs: AMD Thuban /w Asus Crosshair IV (SupremeFX audio chip). Drivers and other software are all up to date and WHQL certified. Thanks.
    Monday, October 25, 2010 7:54 PM

Answers

  • There is a known issue in the emulator for really short sounds.  You should be able to pad silence onto the end of your sound to get around this.  For example, I added about 0.5sec of silence to the end of a 0.2sec sound and the behavior became much more consistent.

    The fortunate news is that this issue only happens in the emulator and is not present on real devices.  Hopefully we'll fix this issue in the emulator so it'll be a better experience for you guys.
    --
    Danny
    Thursday, October 28, 2010 6:18 PM

All replies

  • If you're running the emulator on Vista, there is a known issue that causes sound issues of the type you are describing. The issues won't occur on the device or on Windows 7.
    Monday, October 25, 2010 7:57 PM
  • I wish that were the case, but I am running on Windows 7 64bit.
    Monday, October 25, 2010 9:04 PM
  • Hmm... Are you regularly calling FrameworkDispatcher.Update() in your silverlight application?

    See this article:

    Edit: Also, is it only the short sound effects and not the long ones?
    And, does this issue the same in an XNA application as it is in your silverlight application?


    If yes to both of those questions, you may just want to add a small amount of zeroed out audio to the end of those sound files - just enough to tickle the system not to garble your sounds. It might be a bug.
    Monday, October 25, 2010 9:39 PM
  • "Are you regularly calling FrameworkDispatcher.Update() in your silverlight application?" - Yes. This is required because the runtime will throw an exception if you don't. The only difference is I use the CompositionTarget.Render event to dispatch XNA updates rather that waste cycles on a dispatcher timer. The effect of both approaches are the same from my tests. "Also, is it only the short sound effects and not the long ones?" - Yes. Long sounds have played fine so far, although sometimes they crackle at the end. "does this issue the same in an XNA application as it is in your silverlight application?" - I just tested this in a simple XNA app and the problem exists there too. "you may just want to add a small amount of zeroed out audio to the end of those sound files" - I tried that a while ago actually, but still didn't have any success. I searched a couple of other posts that have brought up similar issues about this. On the bright side I'm not alone, but I do hope the phone itself won't exhibit this problem. I won't know for sure until they ship here next month.
    Monday, October 25, 2010 11:55 PM
  • "Are you regularly calling FrameworkDispatcher.Update() in your silverlight application?"- Yes. This is required because the runtime will throw an exception if you don't. The only difference is I use the CompositionTarget.Render event to dispatch XNA updates rather that waste cycles on a dispatcher timer. The effect of both approaches are the same from my tests."Also, is it only the short sound effects and not the long ones?"- Yes. Long sounds have played fine so far, although sometimes they crackle at the end."does this issue the same in an XNA application as it is in your silverlight application?"- I just tested this in a simple XNA app and the problem exists there too."you may just want to add a small amount of zeroed out audio to the end of those sound files"- I tried that a while ago actually, but still didn't have any success.I searched a couple of other posts that have brought up similar issues about this. On the bright side I'm not alone, but I do hope the phone itself won't exhibit this problem. I won't know for sure until they ship here next month.

    Im doing the exact same as you and experience this as well with the emulator.  I haven't been able to verify if the problem will also be there on the phone.
    Wednesday, October 27, 2010 11:09 PM
  • There is a known issue in the emulator for really short sounds.  You should be able to pad silence onto the end of your sound to get around this.  For example, I added about 0.5sec of silence to the end of a 0.2sec sound and the behavior became much more consistent.

    The fortunate news is that this issue only happens in the emulator and is not present on real devices.  Hopefully we'll fix this issue in the emulator so it'll be a better experience for you guys.
    --
    Danny
    Thursday, October 28, 2010 6:18 PM
  • I'm having this problem too. I think it may be occurring on handsets as well. I've had some complaints about poor quality sound and "it sounds like it's wrecking my phone's speaker." I've tried adding silence to the end of the sound, but that doesn't seem to help.
    Wednesday, January 5, 2011 10:24 PM
  • I'm experiencing this issue as well. I'm running windows 7 64 bit. Any word on if this will ever get fixed or not? I'm hoping this is my problem and I'm not doing something wrong, however playing a sound seems pretty simple so I don't think there is much I mess up on.
    Tuesday, July 26, 2011 7:13 PM
  • I'm having problems with short sounds on the emulator as well in my XNA game. I updated to the most recent SDK.

    Can anyone confirm whether this works correctly on the device?
    Tuesday, April 24, 2012 11:32 AM
  • If anyone's curious:

    On the Samsung Focus the stutters and incomplete sounds are still there, but we have worked around it by padding a little bit of silence to the BEGINNING of the wave, and that seems to work nicely.
    Friday, April 27, 2012 6:05 PM
  • I am having a similar problem with a Samsung Focus S and an older Focus, and in the emulator.

    I do not get the problem when I have no song playing as background music, or if Zune music is playing in the background.

    This popping/crackle only happens when I am using MediaPlayer for background and SoundEffect for game sounds, and it will happen if I am using an audio manager or just straight code.  Just for grins sake I disable all the physics, draw calls, etc and the problem was still repeatable.

    I have padded the audio, as it is a short looping sound for an object moving (which just makes it sound like junk when it hits the padding of course, but I wanted to test it).  I have double and tripled the length of the short wav clip all with the same crackle/pop which does appear to be completely random.

    Playing both files through SoundEffect does not cause the problem, only when one is a song and using mediaplayer.

    I can reverse the two sounds from Song to Sound Effect and still have the issue.

    Files are saved as wav 44Hz, 16bit.  But can reproduce with the music as a WMA file.

    Update: I can repeat using a blank GSM template from the code samples here, and trying the two audio files as stated.  Correction, I now can't repeat in the emulator but was able to yesterday (have rebooted).  Can repeat each time on the phones, both the blank GSM and my project.

    Update 2:  When I use the microphone jack to capture the audio through my PC or use headphones the sound artifact is not evident on either device - however at all volume levels it is evident on the devices.  I have called to RMA the Focus S to see if that changes anything.  Regardless it is odd that it only happens when both MediaPlayer and SoundEffect are used at the same time, and not when playing both of the same files through SoundEffect?
    Monday, May 21, 2012 9:24 PM