Comments (12)
Yeah, we're moving to the Aurora namespace soon(tm).
from aurora.js.
Excellent... insert meme
from aurora.js.
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.
@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.
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.
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.
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.
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.
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.
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.
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.
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)
- How do I decode to raw, resample to 44,1khz and split stereo into dual mono buffers?
- "Something is wrong in HTTPSource.loop" while using AV.Asset.fromURL(remoteUrl)
- [Solved]switch backend from Speaker to PortAudio(naudiodon)
- Aurora not playing certain flac files with no error
- Live decoding on Android
- Node example HOT 1
- No default jsDelivr CDN file set
- Problems with 24-bit WAV files
- Questions about memory manage.
- Is decoding a specific part of a gargantuan file supported efficiently? HOT 3
- HTTP requests still sending to server even if HTTP error is returned
- Unit tests fail on master branch
- Chrome browser change for same site cookies
- gyp build fail HOT 1
- build for browser
- m4a demuxer fails when processing a file with co64 atom
- Window Not Defined
- decode fail
- How to install additional codecs? HOT 1
- Uncaught SyntaxError: Unexpected identifier 'key'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aurora.js.