Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ts] Add first event audio implementation to webplayer #2169

Open
wants to merge 19 commits into
base: 4.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a8a79eb
[ts] Add first event audio implementation to webplayer
daaaaa Oct 5, 2022
8befe7f
[spine-ts] Audio pause/resume implemented
daaaaa Oct 8, 2022
20d9b68
[spine-ts][player] support balance/panning for older browser too
daaaaa Oct 8, 2022
1d12326
[ts-spine][player] Solved queuing audio when scrubbing
daaaaa Oct 22, 2022
b2f919f
[ts-spine][player] Audio decode errors simply log an error and not st…
daaaaa Oct 22, 2022
e4191c0
[ts-spine][player] Add audio speed control
daaaaa Oct 22, 2022
3903968
[ts-spine][player] AudioBuffer is decoded only once
daaaaa Oct 22, 2022
6938b3b
[ts-spine][player] Audio Floating button
daaaaa Oct 23, 2022
62444c1
[ts-spine][player] Fixed loadAudio to supppoert rawDataURIs
daaaaa Oct 29, 2022
45ba118
[ts-spine][player] Audio floating button disappear countdown starts w…
daaaaa Oct 30, 2022
b51f9f9
[ts-spine][player] Reimplementation of audio loading. Events already …
daaaaa Nov 1, 2022
2151ce3
[ts-spine][player] Changing speed will change rate of audio currently…
daaaaa Nov 2, 2022
4befd15
[ts-spine][player] Refactoring adding an AudioManager class within th…
daaaaa Nov 12, 2022
f3315e0
[ts-spine][player] Changed audio and animation icons
daaaaa Nov 20, 2022
c5f9728
[ts-spine][player] Fixed audio bug with colliding names
daaaaa Nov 20, 2022
064ad85
[spine-ts][player] Removed mix-and-match example and used raptor-pro …
daaaaa Dec 11, 2022
0688dd2
[spine-ts][player] Exported raptor with audio events
daaaaa Dec 11, 2022
d158b9e
[spine-ts][player] Add to spine-player example raptor with audio
daaaaa Dec 11, 2022
edec640
[spine-ts][player] Add webplayer with audio in player exmaple html
daaaaa Dec 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/export/runtimes.sh
Expand Up @@ -348,10 +348,11 @@ cp -f ../raptor/export/raptor-pro.json "$ROOT/spine-ts/spine-threejs/example/ass
cp -f ../raptor/export/raptor.atlas "$ROOT/spine-ts/spine-threejs/example/assets/"
cp -f ../raptor/export/raptor.png "$ROOT/spine-ts/spine-threejs/example/assets/"

rm "$ROOT/spine-ts/spine-player/example/assets/"*
rm -rf "$ROOT/spine-ts/spine-player/example/assets/"*
cp -f ../raptor/export/raptor-pro.json "$ROOT/spine-ts/spine-player/example/assets/"
cp -f ../raptor/export/raptor-pma.atlas "$ROOT/spine-ts/spine-player/example/assets/"
cp -f ../raptor/export/raptor-pma.png "$ROOT/spine-ts/spine-player/example/assets/"
cp -rf ../raptor/audio "$ROOT/spine-ts/spine-player/example/assets/"

cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-ts/spine-player/example/assets/"
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-ts/spine-player/example/assets/"
Expand Down
Binary file added examples/raptor/audio/jump.mp3
Binary file not shown.
Binary file added examples/raptor/audio/roar.mp3
Binary file not shown.
Binary file added examples/raptor/audio/step.mp3
Binary file not shown.
43 changes: 26 additions & 17 deletions examples/raptor/export/raptor-pro.json

Large diffs are not rendered by default.

Binary file modified examples/raptor/export/raptor-pro.skel
Binary file not shown.
Binary file modified examples/raptor/raptor-pro.spine
Binary file not shown.
45 changes: 27 additions & 18 deletions spine-cocos2d-objc/Resources/raptor-pro.json

Large diffs are not rendered by default.

45 changes: 27 additions & 18 deletions spine-cocos2dx/example/Resources/common/raptor-pro.json

Large diffs are not rendered by default.

45 changes: 27 additions & 18 deletions spine-libgdx/spine-libgdx-tests/assets/raptor/raptor-pro.json

Large diffs are not rendered by default.

45 changes: 27 additions & 18 deletions spine-monogame/spine-monogame-example/data/raptor-pro.json

Large diffs are not rendered by default.

45 changes: 27 additions & 18 deletions spine-sfml/c/data/raptor-pro.json

Large diffs are not rendered by default.

45 changes: 27 additions & 18 deletions spine-sfml/cpp/data/raptor-pro.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spine-sfml/cpp/data/spineboy-pro.json
@@ -1,7 +1,7 @@
{
"skeleton": {
"hash": "itfFESDjM1c",
"spine": "4.1.23-beta",
"spine": "4.1.17",
"x": -188.63,
"y": -7.94,
"width": 418.45,
Expand Down
12 changes: 12 additions & 0 deletions spine-ts/spine-core/src/AssetManagerBase.ts
Expand Up @@ -120,6 +120,18 @@ export class AssetManagerBase implements Disposable {
});
}

loadAudio (path: string,
success: (path: string, texture: Texture) => void = () => { },
error: (path: string, message: string) => void = () => { }) {
path = this.start(path);

this.downloader.downloadBinary(path, (data: Uint8Array): void => {
this.success(success, path, data.buffer);
}, (status: number, responseText: string): void => {
this.error(error, path, `Couldn't load binary ${path}: status ${status}, ${responseText}`);
});
}

loadTexture (path: string,
success: (path: string, texture: Texture) => void = () => { },
error: (path: string, message: string) => void = () => { }) {
Expand Down
43 changes: 40 additions & 3 deletions spine-ts/spine-player/css/spine-player.css

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
45 changes: 27 additions & 18 deletions spine-ts/spine-player/example/assets/raptor-pro.json

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions spine-ts/spine-player/example/example.html
Expand Up @@ -25,6 +25,7 @@
<button id="screenshot">Screenshot</button>
</div>
<img id="screenshot-image" src="" style="width: 400px;">
<div id="container-raptor-audio" style="width:640px; height:380px"></div>
</body>
<script>
// Creates a new spine player. The debugRender option enables
Expand Down Expand Up @@ -74,6 +75,17 @@
});
}
});

// Creates a new spine player with audio enabled.
new spine.SpinePlayer("container-raptor-audio", {
jsonUrl: "assets/raptor-pro.json",
atlasUrl: "assets/raptor-pma.atlas",
audioFolderPath: "assets/audio",
animation: "roar",
premultipliedAlpha: true,
backgroundColor: "#cccccc",
showControls: true
});
</script>
</body>

Expand Down
286 changes: 282 additions & 4 deletions spine-ts/spine-player/src/Player.ts

Large diffs are not rendered by default.

45 changes: 27 additions & 18 deletions spine-ts/spine-threejs/example/assets/raptor-pro.json

Large diffs are not rendered by default.

45 changes: 27 additions & 18 deletions spine-ts/spine-webgl/example/assets/raptor-pro.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.