Search code examples
silverlightsilverlight-4.0translationwav

How to get rid of the "click" sound at end of translation in Microsoft Translate API in Silverlight app


I am using the MS Translator to send back a WAV file of text to enable "talking" in my Silverlight 4 app.

However, at the end of every translation, there is a wierd click noise (it sounds like someone is turning a microphone on or off).

Here is an online Silverlight app which demonstrates the issue. Type something in and translate it (can be the same language) and listen to the end of the talking.

Is there anything I can do to get rid of this noise? I was thinking of reading the WAV file to 90% and then stopping it before the sound but I would like to understand technically why it's coming back with the noise and where the problem is so I can find the best solution for it.

UPDATE: After Brad's useful lead below it seems that the problem is in the WaveMediaStreamSource that converts the returned WAV into a format that Silverlight can use.

This is the same one mentioned/used in the online project here.

So... any idea how to get rid of the crackling sound when WaveMediaStreamSource converts it?


Solution

  • I'm not sure if this is helpful, but it seems that the click noise isn't in the WAV file itself.

    I used Fiddler to dig out the response coming back from the server and saved that to a WAV file. Opening that in Audacity, I can clearly hear the translation to the end... no click.

    So, that click might be the normal sound of the component in Silverlight stopping. However, I have a different theory.

    The WAV file itself is sampled at 8kHz. That's kind of an oddball. I bet the click noise is an artifact of the sound card or software (silverlight/audio driver/windows itself, etc.) up-sampling to a more appropriate rate. This is testable. Try making a WAV file and use Fiddler or some other HTTP proxy tool to return your WAV instead of what was requested from the Microsoft server. See if your WAV (at 44.1kHz for example) has the same issue.