@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
package/dist/esm/index.js CHANGED
@@ -3719,22 +3719,12 @@ var FaustAudioWorkletNode = class extends (globalThis.AudioWorkletNode || null)
3719
3719
  async listenSensors() {
3720
3720
  if (this.hasAccInput) {
3721
3721
  const isAndroid = /Android/i.test(navigator.userAgent);
3722
- let handleDeviceMotion = null;
3723
- if (isAndroid) {
3724
- handleDeviceMotion = ({ accelerationIncludingGravity }) => {
3725
- if (!accelerationIncludingGravity)
3726
- return;
3727
- const { x, y, z } = accelerationIncludingGravity;
3728
- this.propagateAcc({ x, y, z }, true);
3729
- };
3730
- } else {
3731
- handleDeviceMotion = ({ accelerationIncludingGravity }) => {
3732
- if (!accelerationIncludingGravity)
3733
- return;
3734
- const { x, y, z } = accelerationIncludingGravity;
3735
- this.propagateAcc({ x, y, z });
3736
- };
3737
- }
3722
+ const handleDeviceMotion = ({ accelerationIncludingGravity }) => {
3723
+ if (!accelerationIncludingGravity)
3724
+ return;
3725
+ const { x, y, z } = accelerationIncludingGravity;
3726
+ this.propagateAcc({ x, y, z }, isAndroid);
3727
+ };
3738
3728
  if (window.DeviceMotionEvent) {
3739
3729
  if (typeof window.DeviceMotionEvent.requestPermission === "function") {
3740
3730
  try {
@@ -3983,22 +3973,12 @@ var FaustScriptProcessorNode = class extends (globalThis.ScriptProcessorNode ||
3983
3973
  async listenSensors() {
3984
3974
  if (this.hasAccInput) {
3985
3975
  const isAndroid = /Android/i.test(navigator.userAgent);
3986
- let handleDeviceMotion = null;
3987
- if (isAndroid) {
3988
- handleDeviceMotion = ({ accelerationIncludingGravity }) => {
3989
- if (!accelerationIncludingGravity)
3990
- return;
3991
- const { x, y, z } = accelerationIncludingGravity;
3992
- this.propagateAcc({ x, y, z }, true);
3993
- };
3994
- } else {
3995
- handleDeviceMotion = ({ accelerationIncludingGravity }) => {
3996
- if (!accelerationIncludingGravity)
3997
- return;
3998
- const { x, y, z } = accelerationIncludingGravity;
3999
- this.propagateAcc({ x, y, z });
4000
- };
4001
- }
3976
+ const handleDeviceMotion = ({ accelerationIncludingGravity }) => {
3977
+ if (!accelerationIncludingGravity)
3978
+ return;
3979
+ const { x, y, z } = accelerationIncludingGravity;
3980
+ this.propagateAcc({ x, y, z }, isAndroid);
3981
+ };
4002
3982
  if (window.DeviceMotionEvent) {
4003
3983
  if (typeof window.DeviceMotionEvent.requestPermission === "function") {
4004
3984
  try {