@novely/solid-renderer 0.35.4-exp → 0.35.4-exp.1

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.
Files changed (2) hide show
  1. package/dist/index.jsx +41 -13
  2. package/package.json +1 -1
package/dist/index.jsx CHANGED
@@ -2176,7 +2176,7 @@ function validateConcurrency(concurrency) {
2176
2176
  }
2177
2177
  }
2178
2178
 
2179
- // ../../node_modules/.pnpm/simple-web-audio@0.3.0_postcss@8.4.32/node_modules/simple-web-audio/dist/index.mjs
2179
+ // ../../node_modules/.pnpm/simple-web-audio@0.4.0_postcss@8.4.32/node_modules/simple-web-audio/dist/index.mjs
2180
2180
  var waitForInteraction = (() => {
2181
2181
  const { promise, resolve } = Promise.withResolvers();
2182
2182
  const onUserInteraction = () => {
@@ -2380,6 +2380,18 @@ var createAudio = (options) => {
2380
2380
  }
2381
2381
  return queue.execute();
2382
2382
  },
2383
+ /**
2384
+ * Stop
2385
+ */
2386
+ async stop() {
2387
+ queue.queue.push(
2388
+ pauseAudio,
2389
+ disconnectAudio,
2390
+ createBufferSource,
2391
+ connectSources
2392
+ );
2393
+ return queue.execute();
2394
+ },
2383
2395
  /**
2384
2396
  * Destroy
2385
2397
  */
@@ -2409,6 +2421,18 @@ var createAudio = (options) => {
2409
2421
  */
2410
2422
  get playing() {
2411
2423
  return state.playing;
2424
+ },
2425
+ get volume() {
2426
+ return gainNode.gain.value;
2427
+ },
2428
+ set volume(value) {
2429
+ gainNode.gain.value = value;
2430
+ },
2431
+ get loop() {
2432
+ return bufferSource.loop;
2433
+ },
2434
+ set loop(value) {
2435
+ bufferSource.loop = value;
2412
2436
  }
2413
2437
  };
2414
2438
  };
@@ -2635,12 +2659,14 @@ var createAudio2 = (storageData) => {
2635
2659
  resource.pause();
2636
2660
  },
2637
2661
  play(loop) {
2662
+ try {
2663
+ resource.loop = loop;
2664
+ } catch {
2665
+ }
2638
2666
  resource.play();
2639
2667
  },
2640
2668
  stop() {
2641
- resource.pause().then(() => {
2642
- resource.reset();
2643
- });
2669
+ resource.stop();
2644
2670
  }
2645
2671
  };
2646
2672
  },
@@ -2651,9 +2677,7 @@ var createAudio2 = (storageData) => {
2651
2677
  },
2652
2678
  voiceStop() {
2653
2679
  if (store.voice) {
2654
- store.voice.pause().then(() => {
2655
- store.voice?.reset();
2656
- });
2680
+ store.voice.stop();
2657
2681
  }
2658
2682
  },
2659
2683
  start() {
@@ -2690,9 +2714,7 @@ var createAudio2 = (storageData) => {
2690
2714
  for (const music of [...musics, ...sounds]) {
2691
2715
  if (!music)
2692
2716
  continue;
2693
- music.pause().then(() => {
2694
- music.reset();
2695
- });
2717
+ music.stop();
2696
2718
  }
2697
2719
  this.voiceStop();
2698
2720
  },
@@ -2710,9 +2732,7 @@ var createAudio2 = (storageData) => {
2710
2732
  for (const music of [...musics, ...sounds]) {
2711
2733
  if (!music)
2712
2734
  continue;
2713
- music.pause().then(() => {
2714
- music.reset();
2715
- });
2735
+ music.stop();
2716
2736
  }
2717
2737
  };
2718
2738
  const unsubscribe = storageData.subscribe(() => {
@@ -2722,11 +2742,19 @@ var createAudio2 = (storageData) => {
2722
2742
  for (const audio of Object.values(store[type])) {
2723
2743
  if (!audio)
2724
2744
  continue;
2745
+ try {
2746
+ audio.volume = volume;
2747
+ } catch {
2748
+ }
2725
2749
  }
2726
2750
  }
2727
2751
  if (type === "voice") {
2728
2752
  const audio = store.voice;
2729
2753
  if (audio) {
2754
+ try {
2755
+ audio.volume = volume;
2756
+ } catch {
2757
+ }
2730
2758
  }
2731
2759
  }
2732
2760
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novely/solid-renderer",
3
- "version": "0.35.4-exp",
3
+ "version": "0.35.4-exp.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"