@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
@@ -9766,22 +9766,12 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
9766
9766
  async listenSensors() {
9767
9767
  if (this.hasAccInput) {
9768
9768
  const isAndroid = /Android/i.test(navigator.userAgent);
9769
- let handleDeviceMotion = null;
9770
- if (isAndroid) {
9771
- handleDeviceMotion = ({ accelerationIncludingGravity }) => {
9772
- if (!accelerationIncludingGravity)
9773
- return;
9774
- const { x, y, z } = accelerationIncludingGravity;
9775
- this.propagateAcc({ x, y, z }, true);
9776
- };
9777
- } else {
9778
- handleDeviceMotion = ({ accelerationIncludingGravity }) => {
9779
- if (!accelerationIncludingGravity)
9780
- return;
9781
- const { x, y, z } = accelerationIncludingGravity;
9782
- this.propagateAcc({ x, y, z });
9783
- };
9784
- }
9769
+ const handleDeviceMotion = ({ accelerationIncludingGravity }) => {
9770
+ if (!accelerationIncludingGravity)
9771
+ return;
9772
+ const { x, y, z } = accelerationIncludingGravity;
9773
+ this.propagateAcc({ x, y, z }, isAndroid);
9774
+ };
9785
9775
  if (window.DeviceMotionEvent) {
9786
9776
  if (typeof window.DeviceMotionEvent.requestPermission === "function") {
9787
9777
  try {
@@ -10030,22 +10020,12 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
10030
10020
  async listenSensors() {
10031
10021
  if (this.hasAccInput) {
10032
10022
  const isAndroid = /Android/i.test(navigator.userAgent);
10033
- let handleDeviceMotion = null;
10034
- if (isAndroid) {
10035
- handleDeviceMotion = ({ accelerationIncludingGravity }) => {
10036
- if (!accelerationIncludingGravity)
10037
- return;
10038
- const { x, y, z } = accelerationIncludingGravity;
10039
- this.propagateAcc({ x, y, z }, true);
10040
- };
10041
- } else {
10042
- handleDeviceMotion = ({ accelerationIncludingGravity }) => {
10043
- if (!accelerationIncludingGravity)
10044
- return;
10045
- const { x, y, z } = accelerationIncludingGravity;
10046
- this.propagateAcc({ x, y, z });
10047
- };
10048
- }
10023
+ const handleDeviceMotion = ({ accelerationIncludingGravity }) => {
10024
+ if (!accelerationIncludingGravity)
10025
+ return;
10026
+ const { x, y, z } = accelerationIncludingGravity;
10027
+ this.propagateAcc({ x, y, z }, isAndroid);
10028
+ };
10049
10029
  if (window.DeviceMotionEvent) {
10050
10030
  if (typeof window.DeviceMotionEvent.requestPermission === "function") {
10051
10031
  try {