@@ -20,28 +20,58 @@ and whose source code can be found on our [Github](https://github.com/audiocogs/
20
20
Aurora.js was written by [ @jensnockert ] ( https://github.com/jensnockert ) and [ @devongovett ] ( https://github.com/devongovett )
21
21
of [ Audiocogs] ( https://github.com/audiocogs/ ) .
22
22
23
- ## Building
23
+ ## Usage
24
+
25
+ You can use Aurora.js both in the browser, as well as in Node.js. In the browser,
26
+ you can either download a prebuilt [ release] ( https://github.com/audiocogs/aurora.js/releases )
27
+ or use [ browserify] ( https://github.com/substack/node-browserify ) to build it into your own
28
+ app bundle (see below for Node.js usage - it's the same for browserify).
29
+
30
+ ``` html
31
+ <script src =" aurora.js" ></script >
32
+ <script src =" mp3.js" ></script >
33
+ <!-- more codecs here -->
34
+ ```
24
35
25
- Currently, the [ importer] ( https://github.com/devongovett/importer ) module is used to build Aurora.js. You can run
26
- the development server by first installing ` importer ` with npm, and then running it like this:
36
+ To use Aurora.js in Node.js or a browserify build, you can install it from ` npm ` :
27
37
28
- npm install importer -g
29
- importer browser.coffee -p 8080
38
+ npm install av
30
39
31
- You can also build a static version like this:
40
+ Then, require the module and codecs you need:
41
+
42
+ ``` javascript
43
+ var AV = require (' av' );
44
+ require (' mp3' );
45
+ // more codecs here...
46
+ ```
47
+
48
+ For much more detailed information on how to use Aurora.js, check out the
49
+ [ documentation] ( https://github.com/audiocogs/aurora.js/wiki ) .
50
+
51
+ ## Building
52
+
53
+ We use [ browserify] ( https://github.com/substack/node-browserify ) to build Aurora.js. To build Aurora.js
54
+ for the browser yourself, use the following commands:
32
55
33
- importer browser.coffee aurora.js
56
+ npm install
57
+ make browser
34
58
35
- By itself, Aurora will play LPCM, uLaw and aLaw files in a number of containers. Be sure to add additional codec support
36
- by including some of our other decoders such as [ FLAC.js] ( https://github.com/audiocogs/flac.js ) ,
37
- [ ALAC.js] ( https://github.com/audiocogs/alac.js ) , and [ MP3.js] ( https://github.com/devongovett/mp3.js ) .
59
+ This will place a built ` aurora.js ` file, as well as a source map in the ` build/ ` directory.
60
+
61
+ By itself, Aurora will play LPCM, uLaw and aLaw files in a number of containers.
62
+ Be sure to add additional codec support by including some of our other decoders:
38
63
39
- If you want to build Aurora without the default codecs, you can use the "browser_slim.coffee" profile:
64
+ * [ FLAC.js] ( https://github.com/audiocogs/flac.js )
65
+ * [ ALAC.js] ( https://github.com/audiocogs/alac.js )
66
+ * [ MP3.js] ( https://github.com/audiocogs/mp3.js )
67
+ * [ AAC.js] ( https://github.com/audiocogs/aac.js )
40
68
41
- importer browser_slim.coffee aurora.js
69
+ If you want to build Aurora without the default codecs, you can use the "browser_slim" profile:
70
+
71
+ make browser_slim
42
72
43
73
This can help shave off approx. 30 KB from the joined file, or 20 KB when minified.
44
-
74
+
45
75
## License
46
76
47
77
Aurora.js is released under the MIT license.
0 commit comments