Click here to Skip to main content
15,891,748 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
When I create a Windows Form with a WebBrowser that has a URL of http://translate.google.com/ and run it, it seems to work fine, except for one detail.

When the item is translated, a little speaker icon shows up. Normally (in my real browsers), when I click that, the phrase plays through my speakers. However, in the WebBrowser, no sound plays. Any idea why that is not working or how I could get it to work?
Posted
Comments
DaveAuld 25-Sep-11 4:51am    
What are your real browsers? what are their Versions?
AspDotNetDev 26-Sep-11 20:02pm    
IE9 and FF (not sure what the version is, but I can check if that is really important).
sai sagar 28-May-12 23:25pm    
can you send that code for me.
AspDotNetDev 28-May-12 23:54pm    
I never got it working.

The FF version isn't important.

What is is whether the version of the webbrowser control which is effectively IE supports the HTML audio as you can see http://msdn.microsoft.com/en-us/library/aa741313(v=VS.85).aspx the webbrowser control is a layer between the IE container app and the MSHTML engine. If the shdocvw.dll is a different version from what your Real Browser is seeing then that could be why there is a difference.

The current version on my machine for info is 6.1.7601.17514 (that's in System32) there are in fact 2 versions on the machine, but they are in the WinSXS caches/backup areas.

I have just tried on my machine vb.net winforms with webbrowser control and going to translate.google, and the little speaker works on .Net4 but does not on .Net3.5 despite the icon appearing, so there must be another wrapper around this in winforms which is breaking the functionality.

So the solution would be to switch to .net 4 :)
 
Share this answer
 
Comments
AspDotNetDev 27-Sep-11 23:02pm    
Hmmm, sounds plausible, but still no luck on my computer. My project was using .Net 4 Client Profile, so I changed it to .Net 4 and that didn't work. Also, I was using a C# Windows Forms project, though I doubt that would matter. In C:\Windows\System32\shdocvw.dll is version 6.0.6002.18392. I am also on Windows Vista. I will have to try at work (Windows 7) to see if I have better luck.
AspDotNetDev 28-Sep-11 20:49pm    
Just tried at work (Windows 7 computer) and no luck there either. shdocvw.dll version is 6.1.7600.16385.
Member 4317199 (Paddy) 12-Oct-11 8:37am    
I can't get any sound either (just on google translate so far as I can tell) tried various versions of .Net. Might this be something that works (sometimes) in vb but not in c#?
DaveAuld 12-Oct-11 11:55am    
I have just tried it in C#, works with .Net 3.5, but does not work in .Net 3
I've still not managed to get this to work on my computer (XP) however a colleague I sent the application to running windows 7 had no problems. Two days ago. Yesterday, however, it did not. He says he has not run any windows updates (but having run scandisk because of confusion over error messages caused by him getting confused over what was a folder and what was inside a zip file!!) Does this make any sense??

He has just restored windows to the day before it worked and it still doesn't work!!!!
 
Share this answer
 
v2
Empty Internet Explorer Cache (ie Temporary Internet Files folder) and then restart your application.. it works..
 
Share this answer
 
I have found the file in the Temporary Internet Files folder that causes the problem. It is sound_player2.swf. If you delete this file the sound functions again but unfortunately not until you have closed and restarted the application or navigated the webbrowser to the URL again. If anyone knows why, I'd be glad to hear from them.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900