@grame/faustwasm 0.8.0 → 0.8.2

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.
@@ -835,11 +835,11 @@ export declare class FaustBaseWebAudioDsp implements IFaustBaseWebAudioDsp {
835
835
  getUI(): FaustUIDescriptor;
836
836
  getDescriptors(): FaustUIInputItem[];
837
837
  hasSoundfiles(): boolean;
838
+ startSensors(): void;
839
+ stopSensors(): void;
838
840
  start(): void;
839
841
  stop(): void;
840
842
  destroy(): void;
841
- startSensors(): void;
842
- stopSensors(): void;
843
843
  }
844
844
  export declare class FaustMonoWebAudioDsp extends FaustBaseWebAudioDsp implements IFaustMonoWebAudioDsp {
845
845
  private fInstance;
@@ -2452,6 +2452,12 @@ var FaustBaseWebAudioDsp = class _FaustBaseWebAudioDsp {
2452
2452
  hasSoundfiles() {
2453
2453
  return this.fSoundfiles.length > 0;
2454
2454
  }
2455
+ startSensors() {
2456
+ this.startSensors();
2457
+ }
2458
+ stopSensors() {
2459
+ this.stopSensors();
2460
+ }
2455
2461
  start() {
2456
2462
  this.fProcessing = true;
2457
2463
  }
@@ -2464,12 +2470,6 @@ var FaustBaseWebAudioDsp = class _FaustBaseWebAudioDsp {
2464
2470
  this.fComputeHandler = null;
2465
2471
  this.fPlotHandler = null;
2466
2472
  }
2467
- startSensors() {
2468
- this.startSensors();
2469
- }
2470
- stopSensors() {
2471
- this.stopSensors();
2472
- }
2473
2473
  };
2474
2474
  var FaustMonoWebAudioDsp = class extends FaustBaseWebAudioDsp {
2475
2475
  constructor(instance, sampleRate, sampleSize, bufferSize, soundfiles) {
@@ -3918,42 +3918,14 @@ var FaustAudioWorkletNode = class extends (globalThis.AudioWorkletNode || null)
3918
3918
  async startSensors() {
3919
3919
  if (this.hasAccInput) {
3920
3920
  if (window.DeviceMotionEvent) {
3921
- if (typeof window.DeviceMotionEvent.requestPermission === "function") {
3922
- try {
3923
- const response = await window.DeviceMotionEvent.requestPermission();
3924
- if (response === "granted") {
3925
- window.addEventListener("devicemotion", this.handleDeviceMotion, true);
3926
- } else if (response === "denied") {
3927
- alert("You have denied access to motion and orientation data. To enable it, go to Settings > Safari > Motion & Orientation Access.");
3928
- throw new Error("Unable to access the accelerometer.");
3929
- }
3930
- } catch (error) {
3931
- console.error(error);
3932
- }
3933
- } else {
3934
- window.addEventListener("devicemotion", this.handleDeviceMotion, true);
3935
- }
3921
+ window.addEventListener("devicemotion", this.handleDeviceMotion, true);
3936
3922
  } else {
3937
3923
  console.log("Cannot set the accelerometer handler.");
3938
3924
  }
3939
3925
  }
3940
3926
  if (this.hasGyrInput) {
3941
3927
  if (window.DeviceMotionEvent) {
3942
- if (typeof window.DeviceOrientationEvent.requestPermission === "function") {
3943
- try {
3944
- const response = await window.DeviceOrientationEvent.requestPermission();
3945
- if (response === "granted") {
3946
- window.addEventListener("deviceorientation", this.handleDeviceOrientation, true);
3947
- } else if (response === "denied") {
3948
- alert("You have denied access to motion and orientation data. To enable it, go to Settings > Safari > Motion & Orientation Access.");
3949
- throw new Error("Unable to access the gyroscope.");
3950
- }
3951
- } catch (error) {
3952
- console.error(error);
3953
- }
3954
- } else {
3955
- window.addEventListener("deviceorientation", this.handleDeviceOrientation, true);
3956
- }
3928
+ window.addEventListener("deviceorientation", this.handleDeviceOrientation, true);
3957
3929
  } else {
3958
3930
  console.log("Cannot set the gyroscope handler.");
3959
3931
  }