title: nodejs can't play audio from URL
body: <p>I've googled now for half day and I guess the problem is that I don't know what the real problem is, so I fail to google it right!</p>
  
  <p>Better to bring the code in:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;title&gt;test&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;audio controls&gt;
    &lt;source src="http://translate.google.com/translate_tts?tl=en&amp;q=Canada" type="audio/mpeg"&gt;
  &lt;/audio&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>If you save this as an html file and open it in a browser (tested on Firefox / Windows) the audio will be played with no problem.</p>
  
  <p>Now I was to start a nodejs application and created this proof-of-concept server:</p>
  
  <pre><code>var express = require('express'),
  app = express(),
  bodyparser = require('body-parser'),
  methodOverride = require('method-override'),
  morgan = require('morgan'),
  port = Number(process.env.PORT || 8090);
  
  app.use(express.static(__dirname + '/public'));
  app.use(bodyparser.json());
  app.use(bodyparser.json({'type':'application/vnd.api+json'}));
  app.use(bodyparser.urlencoded({'extended':'true'}));
  app.use(methodOverride('X-HTTP-Method-Override'));
  app.use(morgan('dev'));
  
  app.get('*', function(req, res){
      res.render('index');
  });
  
  app.listen(port, function(){
      console.log('running port: ' + port);
  });
  </code></pre>
  
  <p>When I run it, I get these errors:</p>
  
  <pre><code>HTTP load failed with status 404. Load of media resource http://translate.google.com/translate_tts?tl=en&amp;q=Maple failed.
  All candidate resources failed to load. Media load paused.
  </code></pre>
  
  <p>I was thinking of it as a CORS problem, but then I proved to myself that it's a wrong guess very simply, by just brining a url to an mp3 file:</p>
  
  <pre><code>http://transom.org/wp-content/uploads/2004/03/stereo_96kbps.mp3
  </code></pre>
  
  <p>and it worked! If I provide a URL to an mp3 file, both simple html file and the one served by nodejs work fine. I then tried adding type to the audio source tag:</p>
  
  <pre><code>type="audio/mpeg"
  </code></pre>
  
  <p>which proved to have no effect here.</p>
  
  <p>So what the real problem is please? </p>