Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 24-Sep-11 17:11pm
AspDotNetDev191.5K
Comments
DaveAuld at 25-Sep-11 4:51am
   
What are your real browsers? what are their Versions?
AspDotNetDev at 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 at 28-May-12 23:25pm
   
can you send that code for me.
AspDotNetDev at 28-May-12 23:54pm
   
I never got it working.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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 Smile | :)
  Permalink  
Comments
AspDotNetDev at 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 at 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 at 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 at 12-Oct-11 11:55am
   
I have just tried it in C#, works with .Net 3.5, but does not work in .Net 3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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!!!!
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Empty Internet Explorer Cache (ie Temporary Internet Files folder) and then restart your application.. it works..
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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.
  Permalink  
v2

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 575
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,466
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,897


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 26 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100