tmanderson / ivona-node

Ivona Cloud (via Amazon services) client library for Node
32 stars 5 forks source link

Troubles in conjunction with express.js in Epiphany (GNOME Web) #7

Closed lviggiani closed 7 years ago

lviggiani commented 8 years ago

Hi, I'm using your library to generate and stream an audio on the fly like this.

app.get('/test', function (req, res){
...
  res.setHeader("Content-Type", "audio/mpeg");
  ivona.createVoice(text, options).pipe(res);
});

That works in any browser I tested so far except for Epiphany (GNOME Web) which is based on webkit2gtk. However, if I set the output to OGG codec like this

app.get('/test', function (req, res){
...
  options.body.outputFormat = { codec: "OGG" };
  res.setHeader("Content-Type", "audio/ogg");
  ivona.createVoice(text, options).pipe(res);
});

It will work in Epiphany. Please note that Epiphany HAS mp3 playback capability. In fact if I stream an mp3 from my local file system it will work in Epiphany as well (even if it won't be able to show its duration):

app.get('/test', function (req, res){
    var path = "test.mp3";
    var stat = fs.statSync(path);
    res.setHeader("Content-Type", "audio/mpeg");
    res.setHeader("Content-Length", stat.size);

    fs.createReadStream("test.mp3").pipe(res);
});

My feeling is that EPiphany needs some more information or heading to be set. So I have tryed adding a Content-Length header to the first block of code above but with no luck. Can you help me please?

tmanderson commented 8 years ago

@lviggiani, sorry for getting to this so late. Have you had any progress with this, or are you still having trouble?

tmanderson commented 7 years ago

I'm going to close this unless I hear anything further.