Skip to content

Commit

Permalink
Merge pull request #180 from JernejHabjan/audio-sprites
Browse files Browse the repository at this point in the history
Audio sprites
  • Loading branch information
JernejHabjan authored Feb 11, 2024
2 parents 044adb9 + 1298566 commit 255e68b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class MovementSystem {
}

private onMovementStart() {
// play sound // todo
this.gameObject.scene.sound.playAudioSprite("character", "footstep");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
"type": "animation",
"key": "buildings_1"
},
{
"jsonURL": "assets/sfx/character.json",
"audioURL": [
"assets/sfx/character.mp3"
],
"type": "audioSprite",
"key": "character"
},
{
"url": "assets/probable-waffle/atlas/anims/effects.json",
"type": "animation",
Expand Down
17 changes: 17 additions & 0 deletions apps/client/src/assets/sfx/character.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"resources": [
"apps/client/src/assets/sfx/character.mp3"
],
"spritemap": {
"death1": {
"start": 0,
"end": 1.985375,
"loop": false
},
"footstep": {
"start": 3,
"end": 3.469,
"loop": false
}
}
}
Binary file added apps/client/src/assets/sfx/character.mp3
Binary file not shown.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
"update:check": "nx update",
"dep-graph": "nx dep-graph",
"workspace-schematic": "nx workspace-schematic",
"sme": "nx build client --source-map=true --named-chunks=true && source-map-explorer dist/apps/client/**/*.js"
"sme": "nx build client --source-map=true --named-chunks=true && source-map-explorer dist/apps/client/**/*.js",
"install-audiosprite-globally": "pnpm install -g audiosprite-ffmpeg",
"probable-waffle-audio-sprites": "pnpm run install-audiosprite-globally && audiosprite apps/client/src/metadata/sfx/character/**/*.mp3 -o apps/client/src/assets/sfx/character -e mp3 -r 8000"
},
"engines": {
"node": ">=16.16.0"
Expand Down

0 comments on commit 255e68b

Please sign in to comment.