Giter Club home page Giter Club logo

Comments (12)

auroranockert avatar auroranockert commented on July 21, 2024

Yeah, we're moving to the Aurora namespace soon(tm).

from aurora.js.

jussi-kalliokoski avatar jussi-kalliokoski commented on July 21, 2024

Excellent... insert meme

from aurora.js.

devongovett avatar devongovett commented on July 21, 2024

Meh, personally I prefer prefixes to class names rather than an object namespace, but yes, this is an issue. And exporting to CommonJS would probably be a nice idea as well.

from aurora.js.

jussi-kalliokoski avatar jussi-kalliokoski commented on July 21, 2024

@devongovett I'm curious if there's a reason why you prefer prefixed class names? Personal preference? Or is there some benefit I don't know about? ;)

from aurora.js.

devongovett avatar devongovett commented on July 21, 2024

Mostly a personal preference. I don't think there would be much if any performance difference. I'd be fine with either as long as the namespace is short. I don't want to type Aurora.Buffer and the like, AU.Buffer or AUBuffer (one char shorter ;) is better IMO, although all the two letter prefixes out of the word Aurora aren't very nice looking... hmm. ABuffer looks silly as well.

from aurora.js.

jussi-kalliokoski avatar jussi-kalliokoski commented on July 21, 2024

Heh, I agree that namespacing makes typing them clunkier, but I think there are a lot of benefits as well. The most important one is of course that we get a single export, giving us easy node.js (and friends) compatibility, as well as extensibility (since node.js modules are memoized, you could use extra codecs pretty easily, just require them, not having to even export anything). Also, namespaces are enumerable. And with ES6 destructuring you could do stuff like let {Buffer, Demuxer} = Aurora. One could also make an interface that inherits Aurora (why one would do that is beyond me though), as well as easily bundle Aurora inside another library (such as audiolib.js, although it's too bloated for that already).

from aurora.js.

devongovett avatar devongovett commented on July 21, 2024

Yeah. The other thing with node compatibility, is that codecs have Aurora dependencies and thus will require('aurora'). But now the codec doesn't work in the browser because there is no such thing as require in the browser. What to do? I guess you'd have to wrap it in a if (!Aurora && require) Aurora = require('aurora') or something. :(

from aurora.js.

jussi-kalliokoski avatar jussi-kalliokoski commented on July 21, 2024

Yeah, I guess you could just wrap the codecs in closures with a signature something like this:

void function (Aurora) {
}(typeof Aurora === 'undefined' ? require('aurora') : Aurora)

Doesn't seem like a huge change, since I understood that you already wrapped one codec in a huge closure using your import package. :)

from aurora.js.

devongovett avatar devongovett commented on July 21, 2024

Hmm, that's the other thing. I'll have to extend the import thing to work with node as well. In all of the codecs except FLAC which is just one file, we've used it to import the various files, but that doesn't work right now as a node module - you'd just get the main file when using node's require on it since the imports are comments. Gotta figure out how to get import to intercept it and merge the files together as it does for the browser. Either that, or you just have to merge the files together on the command line before hand as a sort of compile step. I guess that's easier.

Anyway, I really don't like wrapping things, especially something as complex as the above around everything and requiring everyone who uses Aurora to do that too. Aurora's main target is the browser IMO, but we definitely want it to work on Node as well so we don't want getting things working in Node to hinder things in the browser... Anyway, I'll have to think about it more.

from aurora.js.

 avatar commented on July 21, 2024

Hello,
I'd like to ask if there has been any progress regarding node.js support?
I am currently working on an audio server project that runs with node.js and I urgently need audio decoding capabilities for it. In the project I have to read differnet kinds of audio streams (FLAC, MP3, Wav and ALAC) and decode it for further processing.
Best Charly

from aurora.js.

devongovett avatar devongovett commented on July 21, 2024

Working on it. See the namespace branch where things are under the AV namespace for now. To load plugins/codecs, use AV.require, which makes the namespace available to the codec's scope. It's a work in progress so expect it to change out from under you without notice. :)

from aurora.js.

sebpiq avatar sebpiq commented on July 21, 2024

what's the status for this? I've been looking for node libraries for getting PCM data from sound files (even wave), and couldn't find anything really well maintained or extensive. Looks like you guys have the only serious library for doing something close to that.

from aurora.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.