@grame/faustwasm 0.4.6 → 0.4.8

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 (36) hide show
  1. package/README.md +4 -4
  2. package/assets/standalone/create-node.js +78 -0
  3. package/assets/standalone/faustwasm/index.js +12 -32
  4. package/assets/standalone/faustwasm/index.js.map +2 -2
  5. package/assets/standalone/index-template.html +17 -0
  6. package/assets/standalone/index-template.js +48 -0
  7. package/assets/standalone/index.html +4 -3
  8. package/assets/standalone/index.js +14 -71
  9. package/assets/standalone/manifest.json +5 -6
  10. package/assets/standalone/service-worker.js +51 -27
  11. package/dist/cjs/index.js +12 -32
  12. package/dist/cjs/index.js.map +2 -2
  13. package/dist/cjs-bundle/index.js +12 -32
  14. package/dist/cjs-bundle/index.js.map +2 -2
  15. package/dist/esm/index.js +12 -32
  16. package/dist/esm/index.js.map +2 -2
  17. package/dist/esm-bundle/index.js +12 -32
  18. package/dist/esm-bundle/index.js.map +2 -2
  19. package/fileutils.js +19 -21
  20. package/package.json +1 -1
  21. package/scripts/faust2wasm.js +10 -5
  22. package/src/FaustAudioWorkletNode.ts +5 -14
  23. package/src/FaustScriptProcessorNode.ts +5 -14
  24. package/src/copyWebStandaloneAssets.d.ts +2 -2
  25. package/src/copyWebStandaloneAssets.js +30 -19
  26. package/src/faust2wasmFiles.js +5 -5
  27. package/test/faustlive-wasm/faustwasm/index.js +12 -32
  28. package/test/faustlive-wasm/faustwasm/index.js.map +2 -2
  29. package/assets/standalone/index-poly.js +0 -234
  30. package/assets/standalone/service-worker-poly.js +0 -98
  31. package/assets/standalone/template-poly.html +0 -60
  32. package/assets/standalone/template.html +0 -50
  33. package/assets/standalone/template.js +0 -63
  34. package/assets/standalone/types.d.ts +0 -9
  35. package/node +0 -0
  36. package/src/instantiateFaustModule.js +0 -82
@@ -9721,22 +9721,12 @@ var FaustAudioWorkletNode = class extends (globalThis.AudioWorkletNode || null)
9721
9721
  async listenSensors() {
9722
9722
  if (this.hasAccInput) {
9723
9723
  const isAndroid = /Android/i.test(navigator.userAgent);
9724
- let handleDeviceMotion = null;
9725
- if (isAndroid) {
9726
- handleDeviceMotion = ({ accelerationIncludingGravity }) => {
9727
- if (!accelerationIncludingGravity)
9728
- return;
9729
- const { x, y, z } = accelerationIncludingGravity;
9730
- this.propagateAcc({ x, y, z }, true);
9731
- };
9732
- } else {
9733
- handleDeviceMotion = ({ accelerationIncludingGravity }) => {
9734
- if (!accelerationIncludingGravity)
9735
- return;
9736
- const { x, y, z } = accelerationIncludingGravity;
9737
- this.propagateAcc({ x, y, z });
9738
- };
9739
- }
9724
+ const handleDeviceMotion = ({ accelerationIncludingGravity }) => {
9725
+ if (!accelerationIncludingGravity)
9726
+ return;
9727
+ const { x, y, z } = accelerationIncludingGravity;
9728
+ this.propagateAcc({ x, y, z }, isAndroid);
9729
+ };
9740
9730
  if (window.DeviceMotionEvent) {
9741
9731
  if (typeof window.DeviceMotionEvent.requestPermission === "function") {
9742
9732
  try {
@@ -9985,22 +9975,12 @@ var FaustScriptProcessorNode = class extends (globalThis.ScriptProcessorNode ||
9985
9975
  async listenSensors() {
9986
9976
  if (this.hasAccInput) {
9987
9977
  const isAndroid = /Android/i.test(navigator.userAgent);
9988
- let handleDeviceMotion = null;
9989
- if (isAndroid) {
9990
- handleDeviceMotion = ({ accelerationIncludingGravity }) => {
9991
- if (!accelerationIncludingGravity)
9992
- return;
9993
- const { x, y, z } = accelerationIncludingGravity;
9994
- this.propagateAcc({ x, y, z }, true);
9995
- };
9996
- } else {
9997
- handleDeviceMotion = ({ accelerationIncludingGravity }) => {
9998
- if (!accelerationIncludingGravity)
9999
- return;
10000
- const { x, y, z } = accelerationIncludingGravity;
10001
- this.propagateAcc({ x, y, z });
10002
- };
10003
- }
9978
+ const handleDeviceMotion = ({ accelerationIncludingGravity }) => {
9979
+ if (!accelerationIncludingGravity)
9980
+ return;
9981
+ const { x, y, z } = accelerationIncludingGravity;
9982
+ this.propagateAcc({ x, y, z }, isAndroid);
9983
+ };
10004
9984
  if (window.DeviceMotionEvent) {
10005
9985
  if (typeof window.DeviceMotionEvent.requestPermission === "function") {
10006
9986
  try {