audiocogs/aurora.js

Playing local files without <input type="file"/>

Opened this issue · 0 comments

Hello, I've stumbled upon the issue to play FLAC files using the Web Audio APIs on older versions on the Chromium engine and Aurora came to the rescue. I'm working on an electron app that involves playing FLACS but my problem is loading those files in aurora.

Since nodejs is the foundation of Electron I tried making a static server and passing those files to Aurora via URL like so:

var nodeStatic = require('node-static')
var staticServer = new nodeStatic.Server('C:\Users\user\Music\Artist\Albums\AlbumName',{
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET',
'Access-Control-Allow-Headers': 'Content-Type: application/x-flac'
}
});
require('http').createServer(function (request, response) {
request.addListener('end', function () {
staticServer.serve(request, response, function (e, res) {
if (e && (e.status === 404)) { // If the file wasn't found
console.log("Not found")
}
});
}).resume();
}).listen(8080);

var player = new AV.Player.fromURL("http://localhost:8080", "/01.%20TrackName.flac")
player.play()

The File is received (I could also open the link in the browser), player.volume shows 1 and player.playing returns true; But no sound is to be heard;

Could that be a mistake of mine or is it not supported?