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.esm.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}
|
|
@@ -7007,9 +7007,11 @@ class Sound
|
|
|
7007
7007
|
}
|
|
7008
7008
|
else if (typeof asset === 'string')
|
|
7009
7009
|
{
|
|
7010
|
-
// load the audio file
|
|
7010
|
+
// load the audio file, report failures rather than leaving an
|
|
7011
|
+
// unhandled rejection, the sound just stays unloaded and silent
|
|
7011
7012
|
const filename = asset;
|
|
7012
|
-
this.loadSound(filename)
|
|
7013
|
+
this.loadSound(filename).catch(e=>
|
|
7014
|
+
LOG('Sound load failed for', filename, '-', e.message));
|
|
7013
7015
|
}
|
|
7014
7016
|
}
|
|
7015
7017
|
|
|
@@ -7366,7 +7368,7 @@ function speak(text, volume=1, rate=1, pitch=1, language='')
|
|
|
7366
7368
|
// build utterance and speak
|
|
7367
7369
|
const utterance = new SpeechSynthesisUtterance(text);
|
|
7368
7370
|
utterance.lang = language;
|
|
7369
|
-
utterance.volume =
|
|
7371
|
+
utterance.volume = volume*soundVolume;
|
|
7370
7372
|
utterance.rate = rate;
|
|
7371
7373
|
utterance.pitch = pitch;
|
|
7372
7374
|
speechSynthesis.speak(utterance);
|