You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-19Lines changed: 28 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,21 @@ This is a `ffmpeg` wrapper that will take in **multiple audio files** and combin
6
6
7
7
### Why?
8
8
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.
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.
110
117
111
-
####Custom silent track
118
+
####Custom silent track
112
119
113
120
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.
114
121
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 =newjukebox.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.
129
123
130
124
First generate LimeJS asset from the JSON file that you can require inside your code.
131
125
@@ -145,3 +139,18 @@ audio.play('click');
145
139
```
146
140
147
141
*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*/};
0 commit comments