danoniplus 42.5.4 → 42.5.5
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/js/danoni_main.js +20 -5
- package/package.json +1 -1
package/js/danoni_main.js
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Source by tickle
|
|
6
6
|
* Created : 2018/10/08
|
|
7
|
-
* Revised : 2025/
|
|
7
|
+
* Revised : 2025/12/30
|
|
8
8
|
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver 42.5.
|
|
12
|
-
const g_revisedDate = `2025/
|
|
11
|
+
const g_version = `Ver 42.5.5`;
|
|
12
|
+
const g_revisedDate = `2025/12/30`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
15
15
|
let g_localVersion = ``;
|
|
@@ -2350,13 +2350,28 @@ class AudioPlayer {
|
|
|
2350
2350
|
this._eventListeners[`canplaythrough`]?.forEach(_listener => _listener());
|
|
2351
2351
|
}
|
|
2352
2352
|
|
|
2353
|
+
/**
|
|
2354
|
+
* 再生処理
|
|
2355
|
+
* @param {number} _adjustmentTime
|
|
2356
|
+
* - 実際の再生開始時間は、scheduleLead + _adjustmentTime から開始される
|
|
2357
|
+
* - ただしゲーム内での経過時間計算は _adjustmentTime を基準に行う
|
|
2358
|
+
* - scheduleLead は安定した再生タイミングを確保するための内部マージン
|
|
2359
|
+
*/
|
|
2353
2360
|
play(_adjustmentTime = 0) {
|
|
2354
2361
|
this._source = this._context.createBufferSource();
|
|
2355
2362
|
this._source.buffer = this._buffer;
|
|
2356
2363
|
this._source.playbackRate.value = this.playbackRate;
|
|
2357
2364
|
this._source.connect(this._gain);
|
|
2358
|
-
|
|
2359
|
-
|
|
2365
|
+
|
|
2366
|
+
// 内部スケジューリング用のマージン時間(100ms)
|
|
2367
|
+
const scheduleLead = 0.1;
|
|
2368
|
+
|
|
2369
|
+
// 実際の予約時刻(内部スケジューリング用のマージンを含む)
|
|
2370
|
+
const startAt = this._context.currentTime + scheduleLead + _adjustmentTime;
|
|
2371
|
+
this._source.start(startAt, this._fadeinPosition);
|
|
2372
|
+
|
|
2373
|
+
// ゲーム側の論理的開始時刻(scheduleLead を含めない)
|
|
2374
|
+
this._startTime = this._context.currentTime + _adjustmentTime;
|
|
2360
2375
|
}
|
|
2361
2376
|
|
|
2362
2377
|
pause() {
|