Google Translate TTS problem - html

I'm testing with a simple HTML file, which contains:
<audio src="http://translate.google.com/translate_tts?tl=en&q=A+simple_text+to+voice+demonstration." controls autoplay>
with Chrome v11.0.696.68 and FF v4.0.1. I'm going through a proxy server and it doesn't work. Nothing gets played and clicking on the play button doesn't work in Chrome. In FF it flashes and then shows an 'X' over the control. The error logs don't show anything.
So I've broken down the steps:
Typing the URL into either browser works
wget -q -U Mozilla -O /tmp/tts.mp3 "http://translate.google.com/translate_tts?tl=en&q=Welcome+to+our+fantastic+text+to+voice+demonstration." gets me a file that plays fine on both browsers.
If I serve this file from my local web server it works fine (i.e. one that doesn't go through the proxy). i.e. src="http://localhost/tts.mp3"
I'm stumped. If the proxy were the problem then wget and address bar access shouldn't work. If the src being a URL were the problem then it shouldn't work from my local server.
Any clues? suggestions?

The reason this isn't working is most likely because translate.google.com restricts certain types of requests to prevent the service from being overloaded. For instance, if you use wget without the "-U Mozilla" user agent option you will get an HTTP 404 because the service restricts responses from wget's default user agent string.
In your case, it looks like what is going on is that translate.google.com is returning a HTTP 404 if a HTTP Referrer is included in the request. When you run wget from command line there is no referrer. When you use the audio tag from within a webpage, an HTTP Referrer is provided when requesting the translation. I just tried the following and got a 404.
wget --referer="http://foo.com" -U Mozilla -O /tmp/tts.mp3 "http://translate.google.com/translate_tts?tl=en&q=Welcome+to+our+fantastic+text+to+voice+demonstration
However if you take the --referer option out, it works.

The service is working here (11-NOV-2011) but is limited to 100 characters. You can split your text into 100 char chunks, download the mp3 result for each chunk and then join the chunks for the final Mp3 file.

Related

Chrome returns ERR_FAILED for localhost

After some experiments with PWA I've encountered a strange issue with Google Chrome only. Every other browser works just fine.
When I load http://localhost the response is: "This site can’t be reached"
The error status is: "ERR_FAILED" (404)
Note:
"ping localhost" returns 127.0.0.1 (as it should be).
wget -qO - 'http://localhost' loads the correct content in terminal.
every other browser loads the correct content.
the setting in /etc/hosts leads to 127.0.0.1
if I access the content via IP (127.0.0.1) it loads just fine.
I have cleared the browsing cache
the PWA cache seems to be clean.
The offline box in the network tab is not checked.
If anyone has any ideas on what could cause the issue please share.
The only clue I have is that in the sources tab of the code inspector
there's the content of sw.js (my service worker) but there's nothing to do with it.
I came out that the issue was caused by a cookie called ServiceWorker.
After deleting it everything works fine.

ERR_CERT_AUTHORITY_INVALID error in Chrome while using Overrides

I'm trying to test some features in a production environment, and to achieve this I'm using Google Chrome overrides, that basically allows you to substitute a remote file with a local file.
It sometimes works, but after a couple of reloads it stops working and all the requests start failing, receiving this error in console:
Pay attention: I'm not talking of the full page warning that you see when you access an untrusted website, which has the same error code. I'm talking about the error in console which makes the website unusable.
I say this because I tried googling the error and I only see articles about the warning, that you can easily skip. This is a different subject.
What I tried so far, without success is:
Start chrome with the --ignore-certificate-errors flag
Enabling the allow-insecure-localhost flag in chrome://flags
But they didn't help. How can I tell Chrome to ignore the (inexistent) certificate?
Thank you
Edit
I add an image of my override configuration:
to-override is my local folder. Then I just clicked on a file in the source tab and selected save for override. I found the file in my local folder and I changed it. Changes are applied the first time, but on refresh everything stops working and all the requests fail.
My Chrome version is
71.0.3578.98 - stable - 64 bit

Unable to connect to https://myserver/VaultService

I have just installed Vault on my machine, I intend touse it single user.
When trying to use it for the first time, I get the error message below.
Is there anything I should enable?
I have the correct passwords.
I am using the Admin account.
I have Windows * 64 bits, Vault is also 64 bits.
Thanks to Beth's answer below, now I can at least visualise the following page, but still not be able to follow the links in it.
This is the result I get when I click on the links(Picture below).
Error messages are below, but the formatting is not good.
Most likely causes: The request matched a wildcard mime map.
The request is mapped to the static file handler. If there were different pre-conditions, the request will map to a different handler.
Things you can try: If you want to serve this content as a static file, add an explicit MIME map.
Detailed Error Information: Module StaticFileModule Notification ExecuteRequestHandler Handler StaticFile Error Code 0x80070032
Requested URL http://vrindavana:80/VaultService/Admin/default.aspx Physical Path C:\inetpub\wwwroot\VaultService\Admin\default.aspx
Logon Method Anonymous
Logon User Anonymous
IIS:
I have IIS installed and if I browse it I see what's on the picture below.
First try reaching the Vault server using a browser. Try the URL http://<your Vault server name>/vaultservice/index.html. If you can not reach that page, then change to either the FQDN or the IP address.
If you still cannot reach the index.html page, then try reaching it using a browser right on the server and use localhost. The URL would then be http://localhost/vaultservice/index.html.
Let me know the results of these URLs first and then I'll give you next steps.
Beth
SourceGear Technical Support
Thanks for the update.
The error seems to indicate a problem with the .NET Framework. Here are the next steps you should try.
1) Register the .NET framework with IIS. Run a command-prompt as administrator and then change directories until you get to the highest version of the 4.x .NET framework. It might look something like cd C:\Windows\Microsoft.net\framework64\v4.0.30319, but I'm not sure of the entire path on your machine. Then run the command aspnet_regiis -i.
Then try your web page again.
2) If you then get a 404.2 error, then open your IIS Manager, click on the machine name and then click on ISAPI and CGI restrictions. Make sure the .NET frameworks are set to Allow there.

How to get http status from a website run on the play framework

Please forgive my ignorance. I don't know anything about the play framework, or the MVC design pattern so please bear with me.
I need to write a shell script to check if our service is still up. I had planned to use curl to get the http response code and check if it's a 200 or 404. We are using the play framework and designing the site using the MVC design pattern. I know nothing about these 2 things so it might be adding to my confusion.
Anyway, the website is up because I checked in Chrome and FF and it's up and working. I ran this curl command, which should give me a 200:
curl -I http://oursite.com:8080
HTTP/1.1 404 Not Found
Content-Type: text/html; charset=utf-8
Content-Length: 1900
As a return code in the header, I get a 404. I don't know much about web technology but I read up on 404 status codes from wikipedia and it seems like it's looking for a index.html page (or whatever the requested page is). I found a /dir/of/play/deployment/public directory on our server. I blindly created an index.html in it but it didn't help. I still got a 404 when I was expecting a 200.
I also tried using wget. wget gives me a 200, but it downloads the contents of the main page to my local acct to a file called index.html. I ran
wget http://oursite.com:8080
--2014-01-29 19:42:42-- http://oursite.com:8080/
Resolving oursite.com... 10.64.8.76
Connecting to oursite.com|10.64.8.76|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27181 (27K) [text/html]
Saving to: “index.html”
I also ran another wget command but this one gave me a 404. I used the spider option to not download the file locally.
wget --spider http://oursite.com:8080
Spider mode enabled. Check if remote file exists.
--2014-01-29 19:42:42-- http://oursite.com:8080/
Resolving oursite.com... 10.64.8.76
Connecting to oursite.com|10.64.8.76|:8080... connected.
HTTP request sent, awaiting response... 404 Not Found
Remote file does not exist -- broken link!!!
The output of the last command said there's a remote file that it's looking for but can't find. However, clearly the site was sending some content when it wasn't in spider mode thanks to the creation/existence of the index.html pg in my local dir.
So the question is, what is this page that curl and "wget --spider" looking for and why did plain wget "find" this file and download its contents? Am I approaching this problem correctly (using curl or wget to see if the webservice is up and running) or am I attacking this problem wrong and should use something else to check?
Thanks in advance for your help.
I suspect this is due to:
https://github.com/playframework/playframework/issues/2280
You'll need to make a regular GET call instead with an -i:
curl -is http://myapp.com | awk '/HTTP\/1.1 (.*) (.*?)/ {print $2}'
This should return 200 all is working.
One tip: in Chrome developer tools, in the network tab you can right click a request and 'Copy as cUrl'. You could compare this request with your handwritten cUrl request.

No live audio input: [object NavigatorUserMediaError]

I am trying out the example given here https://github.com/mattdiamond/Recorderjs - example_simple_exportwav.html. But, I am getting this error
No live audio input: [object NavigatorUserMediaError]
I am on WindowsXP and have enabled WebAudio for Chrome (Version 24.0.1312.56 m). What could be the problem?
I ran into this same issue, with the same example. Turns out you have to be serving the page from an HTTP server, as Chrome won't allow the audio input from a "file:///" page. An easy way to accomplish this, if you have Python installed, is to run the following in the directory containing the example file:
python -m SimpleHTTPServer
Now, point Chrome localhost:8000 and the example should work.
Hello you have to run it in HTTPS not HTTP.
When you are in https, the browser ask you for the permission of the microphone.
Hope you find this helpful.