audiocogs / aac.js

AAC decoder in JavaScript.
http://audiocogs.org/codecs/aac/
GNU Lesser General Public License v3.0
222 stars 45 forks source link

Is this stable? #2

Closed NHQ closed 11 years ago

NHQ commented 11 years ago

Howdy, I am having difficulties getting Aurora up and working with AAC. I have the loading of assets working fine, but I can't get the Player to play. On Player(asset).startPlaying() I get a vague error "Cannot call 'read' of undefined". If I dig into it, I see that the asset doesn't have a format defined. I think it's an acc.js related issue, but I haven't tested any others. I can't get the demo site to play an acc file either.

I have been hitting it a while now. One thing I noticed is that it doesn't seem that aac.js registers a demuxer, like the default encodings do. eg:

Demuxer.register(AIFFDemuxer)

I'm still plugging away at it, and will report back any findings.

While I am here, I must recommend you all get with Node/Common js, NPM, and use browserify to build. Build modules. Then your streams, events, buffers and modules will be compatible with a world o' modules that work both in the browser and in Node.js. Right now, the whole project is relatively decomposed, yet those parts all rely on each other in non-decomposable ways. I can't 'npm install aac', stream buffers into it and get a stream of PCM out. In my mind, that is what acc.js should do. Instead, I have to use this framework with its globals, contextual oddities, integrated load/play, and the incompatibilities.

I mean no offense. It is obvious a lot of work has gone into aurora and the decoders. It's a shame it isn't nicer to play with.

devongovett commented 11 years ago
  1. I assume you're using the latest version of Aurora? The latest version (now merged into master) is namespaced and only exports a single AV object instead of lots of globals (e.g. AV.Player instead of global Player).
  2. AAC files don't usually have their own container format, and are usually found in M4A files (MPEG audio). There is a .aac format or ADTS but it's very rarely used except in streaming radio applications. Aurora contains an M4A demuxer automatically.
  3. Where are you getting this error? What line? Sounds like an issue reading the file, and perhaps it's an issue with the file you're reading or the way its been setup. I can probably help you if you give me more info.
  4. As for build system, I'm not really a big fan of the node module system or browserify myself. The reason you can't install aac and stream buffers into it is because aac.js is dependent on the Aurora.js framework. AAC.js is basically just a plugin for Aurora, which is what end users should touch. And it needs to work in the browser and in node, which means we can't use Node buffers or any of the Node stream stuff, and needed to build our own. To be honest, I've only briefly tested this in Node and it hasn't been a priority since I see it as mostly useful in the browser.
  5. I'd be interested to hear more about these contextual oddities and incompatibilities you're complaining of.