Skip to content

Commit 8647c97

Browse files
authored
Merge pull request #62 from tonistiigi/develop
Release 0.7.0 (develop => master)
2 parents d382bee + 6a4a56b commit 8647c97

File tree

7 files changed

+131
-101
lines changed

7 files changed

+131
-101
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cli.js eol=lf

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
language: node_js
22
node_js:
3-
- "0.10"
4-
- "0.12"
5-
- "iojs"
3+
- "7"
4+
- "node"
65

76
before_script:
87
- wget http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz
98
- tar xvf ffmpeg-release-64bit-static.tar.xz
10-
- export PATH=$PATH:$PWD/ffmpeg-2.6.1-64bit-static
9+
- mv ffmpeg-*.*.*-64bit-static ffmpeg
10+
- export PATH=$PATH:$PWD/ffmpeg

README.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,21 @@ This is a `ffmpeg` wrapper that will take in **multiple audio files** and combin
66

77
### Why?
88

9-
iOS, Windows Phone and some Android phones have very limited HTML5 audio support. They only support playing single file at a time and loading in new files requires user interaction and has a big latency. To overcome this there is a technique to combine all audio into single file and only play/loop certain parts of that file. [zynga/jukebox](https://github.com/zynga/jukebox) is a audio framework that uses this technique. [digitalfruit/limejs](https://github.com/digitalfruit/limejs) is a HTML5 game framework that includes Jukebox and lets you add audio to your games using audio sprites.
9+
iOS, Windows Phone and some Android phones have very limited HTML5 audio support. They only support playing a single file at a time and loading in new files requires user interaction and has a big latency. To overcome this there is a technique to combine all audio into single file and only play/loop certain parts of that file. [zynga/jukebox](https://github.com/zynga/jukebox) is a audio framework that uses this technique. [digitalfruit/limejs](https://github.com/digitalfruit/limejs) is a HTML5 game framework that includes Jukebox and lets you add audio to your games using audio sprites.
1010

11-
###Installation
11+
### Installation
1212

13+
#### via npm package
1314
```
1415
npm install -g audiosprite
1516
```
1617

18+
### via github (latest)
19+
```
20+
npm install -g git+https://github.com/tonistiigi/audiosprite.git
21+
```
22+
23+
#### Dependencies
1724
You can install `FFmpeg` and the `ogg` codecs on OSX using `brew`:
1825

1926
```
@@ -90,7 +97,7 @@ info: All done
9097
}
9198
```
9299

93-
###API Usage
100+
### API Usage
94101
```js
95102
var audiosprite = require('audiosprite')
96103

@@ -104,28 +111,15 @@ audiosprite(files, opts, function(err, obj) {
104111
})
105112
```
106113

107-
####Setting autoplay track
114+
#### Setting autoplay track
108115

109116
You can use `--autoplay` option to set a track that will start playing automatically. This track is then marked as autoplay and looping in the JSON. This syntax is Jukebox framework specific.
110117

111-
####Custom silent track
118+
#### Custom silent track
112119

113120
On some cases starting and pausing a file has bigger latency than just setting playhead position. You may get better results if your file is always playing. `--silence <duration>` option will generate extra track named *silence* that you can play instead of pausing the file.
114121

115-
####Usage with [zynga/jukebox](https://github.com/zynga/jukebox) framework.
116-
117-
Generated JSON file can be passed straight into `jukebox.Player` constructor. Check out Jukebox documentation/demos for more info.
118-
119-
```javascript
120-
var settings = {/* JSON generated by audiosprite*/};
121-
...
122-
// This part needs to be in user event callback.
123-
var myPlayer = new jukebox.Player(settings);
124-
...
125-
myPlayer.play('click');
126-
```
127-
128-
####Usage with [digitalfruit/limejs](https://github.com/digitalfruit/limejs) framework.
122+
#### Usage with [digitalfruit/limejs](https://github.com/digitalfruit/limejs) framework.
129123

130124
First generate LimeJS asset from the JSON file that you can require inside your code.
131125

@@ -145,3 +139,18 @@ audio.play('click');
145139
```
146140

147141
*Don't forget to use the `--rawparts=mp3` option to benefit from the LimeJS feature to automatically switch to Web Audio API when it's supported by the client.*
142+
143+
#### Usage with [zynga/jukebox](https://github.com/zynga/jukebox) framework. (DISCONTINUED)
144+
145+
*NOTE: The jukebox project from Zynga has been abandoned. This section remains for reference.*
146+
147+
Generated JSON file can be passed straight into `jukebox.Player` constructor. Check out Jukebox documentation/demos for more info.
148+
149+
```javascript
150+
var settings = {/* JSON generated by audiosprite*/};
151+
...
152+
// This part needs to be in user event callback.
153+
var myPlayer = new jukebox.Player(settings);
154+
...
155+
myPlayer.play('click');
156+
```

0 commit comments

Comments
 (0)