Skip to content

Commit

Permalink
fix audio bug
Browse files Browse the repository at this point in the history
  • Loading branch information
KilledByAPixel committed May 29, 2024
1 parent add61b6 commit 3196546
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions build/littlejs.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2894,7 +2894,7 @@ class Sound
if (zzfxSound)
{
// generate zzfx sound now for fast playback
this.randomness = zzfxSound[1];
this.randomness = zzfxSound[1] || 0;
zzfxSound[1] = 0; // generate without randomness
this.sampleChannels = [zzfxG(...zzfxSound)];
this.sampleRate = zzfxR;
Expand Down Expand Up @@ -4812,7 +4812,7 @@ const engineName = 'LittleJS';
* @type {String}
* @default
* @memberof Engine */
const engineVersion = '1.8.3';
const engineVersion = '1.8.4';

/** Frames per second to update objects
* @type {Number}
Expand Down
4 changes: 2 additions & 2 deletions build/littlejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2894,7 +2894,7 @@ class Sound
if (zzfxSound)
{
// generate zzfx sound now for fast playback
this.randomness = zzfxSound[1];
this.randomness = zzfxSound[1] || 0;
zzfxSound[1] = 0; // generate without randomness
this.sampleChannels = [zzfxG(...zzfxSound)];
this.sampleRate = zzfxR;
Expand Down Expand Up @@ -4812,7 +4812,7 @@ const engineName = 'LittleJS';
* @type {String}
* @default
* @memberof Engine */
const engineVersion = '1.8.3';
const engineVersion = '1.8.4';

/** Frames per second to update objects
* @type {Number}
Expand Down
2 changes: 1 addition & 1 deletion build/littlejs.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/littlejs.release.js
Original file line number Diff line number Diff line change
Expand Up @@ -2517,7 +2517,7 @@ class Sound
if (zzfxSound)
{
// generate zzfx sound now for fast playback
this.randomness = zzfxSound[1];
this.randomness = zzfxSound[1] || 0;
zzfxSound[1] = 0; // generate without randomness
this.sampleChannels = [zzfxG(...zzfxSound)];
this.sampleRate = zzfxR;
Expand Down Expand Up @@ -4435,7 +4435,7 @@ const engineName = 'LittleJS';
* @type {String}
* @default
* @memberof Engine */
const engineVersion = '1.8.3';
const engineVersion = '1.8.4';

/** Frames per second to update objects
* @type {Number}
Expand Down
2 changes: 1 addition & 1 deletion examples/breakout/gameObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class Ball extends EngineObject
this.velocity = this.velocity.normalize(speed);

// scale bounce sound pitch by speed
sound_bounce.play(this.pos, 1, speed);
sound_bounce.play(this.pos, 1, speed*2);

if (o == paddle)
{
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "littlejsengine",
"version": "1.8.3",
"version": "1.8.4",
"description": "LittleJS - Tiny and Fast HTML5 Game Engine",
"main": "build/littlejs.esm.js",
"types": "build/littlejs.esm.js",
Expand Down
2 changes: 1 addition & 1 deletion src/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const engineName = 'LittleJS';
* @type {String}
* @default
* @memberof Engine */
const engineVersion = '1.8.3';
const engineVersion = '1.8.4';

/** Frames per second to update objects
* @type {Number}
Expand Down
2 changes: 1 addition & 1 deletion src/engineAudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Sound
if (zzfxSound)
{
// generate zzfx sound now for fast playback
this.randomness = zzfxSound[1];
this.randomness = zzfxSound[1] || 0;
zzfxSound[1] = 0; // generate without randomness
this.sampleChannels = [zzfxG(...zzfxSound)];
this.sampleRate = zzfxR;
Expand Down

0 comments on commit 3196546

Please sign in to comment.