Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage on server-side (node) only for decoding #96

Closed
Pheo-Player opened this issue Sep 29, 2014 · 12 comments
Closed

Usage on server-side (node) only for decoding #96

Pheo-Player opened this issue Sep 29, 2014 · 12 comments

Comments

@Pheo-Player
Copy link

I'm wondering if it's possible to only use the decoding features of Aurora inside a node process, so far I've only seen node being in use for building the browserified version yourself.

If we had a way of using only the decoding features of Aurora, it and its demuxers/decoders could run inside a server and support streaming different audio files as one audio stream in one common re-encoded format.

While I like the discussion in #14 and especially the repo fsbdev/aurora-websocket, they won't really work all too well for FLAC files (>= 10MB per song), as we just stream the raw files and decode them on the client.

Another big advantage would be that the decoding would be decoupled from the client and could never interfere with the GUI, and we wouldn't even need to use aurora inside the browser, as long as a HTML5 supported audio format is streamed.

@devongovett
Copy link
Member

Yes, it's already possible and supported to use Aurora in Node. Just install and require the av module and use the API as usual. As for the streaming aspect, Aurora doesn't yet support encoding so you'd have to use another tool for that.

@Pheo-Player
Copy link
Author

Thank you for the information!

I have the slight problem with installing av that it will not build on my system; to be exact, its dependency speaker won't. As I really only want to use decoding features on a server, an audio output library dependency getting in my way of that is a tad ironic. What should I do about that?

@devongovett
Copy link
Member

Hmm, what's your environment? It says here that on Debian/Ubuntu you need to install ALSA:

sudo apt-get install libasound2-dev

@Pheo-Player
Copy link
Author

After googling around a bit, it seems to be related to the node version I'm using (0.11.x), which is what atom-shell includes and requires. It builds fine on my system when using 0.10.x, but that doesn't help me in this situation.

@devongovett
Copy link
Member

Oh that makes sense. Node 0.11 breaks a lot of native modules. Not really sure what to suggest then. I don't really want to remove the dependency from package.json since I think we'd get complaints from people confused about why it doesn't work when they try to play audio. The real solution is to wait until node-speaker updates for Node 0.11, or use a stable version of node (current is 0.10.32). If you must use 0.11 now, you could try installing via git and manually building by running make js.

@Pheo-Player
Copy link
Author

I understand, that'd not make a lot of sense to most users.

I just tried building with make js after installing the dependencies (and node-speaker failing to build).

I then renamed node.js to av.js, then used var AV = require('./av') in the node console to test if the module loads without problems, and it did. This file includes the node-speaker device:

require './src/devices/node-speaker'

So I'm wondering if it is a good idea / makes sense to just remove this line as I'm manually building anyways, or if I can rely on the line

@supported: Speaker?

inside node-speaker.js. I'm not sure whether that's a safeguard and will stop the device from being used, though.

Thank you for the information so far, it's been very helpful.

@devongovett
Copy link
Member

Yeah that device won't be used since the line above where it tries to require the speaker module will fail (inside a try...catch). So as long as you don't plan to do audio output (i.e. use a Player), that will never be used anyway so you should be all good.

@jussi-kalliokoski
Copy link
Member

speaker should probably actually go to optionalDependencies since that's what it is.

@devongovett
Copy link
Member

@jussi-kalliokoski Does npm install optionalDependencies by default though?

@jussi-kalliokoski
Copy link
Member

Yep, it just makes it non-fatal if it fails to install.
On Sep 30, 2014 9:33 AM, "Devon Govett" notifications@github.com wrote:

@jussi-kalliokoski https://github.com/jussi-kalliokoski Does npm
install optionalDependencies by default though?


Reply to this email directly or view it on GitHub
#96 (comment).

@devongovett
Copy link
Member

Cool, let's do that.

@devongovett
Copy link
Member

OK, just published v0.4.3 with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants