littlejsengine 1.18.28 → 1.18.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/littlejs.esm.js +6 -4
- package/dist/littlejs.esm.min.js +1 -1
- package/dist/littlejs.js +6 -4
- package/dist/littlejs.min.js +1 -1
- package/dist/littlejs.release.js +6 -4
- package/package.json +1 -1
- package/src/engine.js +1 -1
- package/src/engineAudio.js +5 -3
package/dist/littlejs.release.js
CHANGED
|
@@ -35,7 +35,7 @@ const engineName = 'LittleJS';
|
|
|
35
35
|
* @type {string}
|
|
36
36
|
* @default
|
|
37
37
|
* @memberof Engine */
|
|
38
|
-
const engineVersion = '1.18.
|
|
38
|
+
const engineVersion = '1.18.29';
|
|
39
39
|
|
|
40
40
|
/** Frames per second to update
|
|
41
41
|
* @type {number}
|
|
@@ -6316,9 +6316,11 @@ class Sound
|
|
|
6316
6316
|
}
|
|
6317
6317
|
else if (typeof asset === 'string')
|
|
6318
6318
|
{
|
|
6319
|
-
// load the audio file
|
|
6319
|
+
// load the audio file, report failures rather than leaving an
|
|
6320
|
+
// unhandled rejection, the sound just stays unloaded and silent
|
|
6320
6321
|
const filename = asset;
|
|
6321
|
-
this.loadSound(filename)
|
|
6322
|
+
this.loadSound(filename).catch(e=>
|
|
6323
|
+
LOG('Sound load failed for', filename, '-', e.message));
|
|
6322
6324
|
}
|
|
6323
6325
|
}
|
|
6324
6326
|
|
|
@@ -6675,7 +6677,7 @@ function speak(text, volume=1, rate=1, pitch=1, language='')
|
|
|
6675
6677
|
// build utterance and speak
|
|
6676
6678
|
const utterance = new SpeechSynthesisUtterance(text);
|
|
6677
6679
|
utterance.lang = language;
|
|
6678
|
-
utterance.volume =
|
|
6680
|
+
utterance.volume = volume*soundVolume;
|
|
6679
6681
|
utterance.rate = rate;
|
|
6680
6682
|
utterance.pitch = pitch;
|
|
6681
6683
|
speechSynthesis.speak(utterance);
|
package/package.json
CHANGED
package/src/engine.js
CHANGED
package/src/engineAudio.js
CHANGED
|
@@ -131,9 +131,11 @@ class Sound
|
|
|
131
131
|
}
|
|
132
132
|
else if (typeof asset === 'string')
|
|
133
133
|
{
|
|
134
|
-
// load the audio file
|
|
134
|
+
// load the audio file, report failures rather than leaving an
|
|
135
|
+
// unhandled rejection, the sound just stays unloaded and silent
|
|
135
136
|
const filename = asset;
|
|
136
|
-
this.loadSound(filename)
|
|
137
|
+
this.loadSound(filename).catch(e=>
|
|
138
|
+
LOG('Sound load failed for', filename, '-', e.message));
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
141
|
|
|
@@ -490,7 +492,7 @@ function speak(text, volume=1, rate=1, pitch=1, language='')
|
|
|
490
492
|
// build utterance and speak
|
|
491
493
|
const utterance = new SpeechSynthesisUtterance(text);
|
|
492
494
|
utterance.lang = language;
|
|
493
|
-
utterance.volume =
|
|
495
|
+
utterance.volume = volume*soundVolume;
|
|
494
496
|
utterance.rate = rate;
|
|
495
497
|
utterance.pitch = pitch;
|
|
496
498
|
speechSynthesis.speak(utterance);
|