Class Feedback
The Feedback
class is designed to facilitate both audio and haptic feedback functionalities, enabling applications to provide users with auditory signals through beeps and tactile sensations through vibrations.
Name | Description |
---|---|
static beep() |
Initiates a beep sound upon invocation. |
static beepSoundSource |
Returns or sets the beep’s sound source. |
static vibrate() |
Activates device vibration upon invocation. |
static vibrateDuration |
Determines the vibration’s duration in milliseconds. |
beep
Initiates a beep sound upon invocation.
static beep(): void;
Parameter
None.
Return value
None.
Code Snippet
Dynamsoft.DCE.Feedback.beep();
beepSoundSource
Returns or sets the beep’s sound source. The value is either a base64 encoded string that represents the sound or a URL to the sound file.
static beepSoundSource: string;
Code Snippet
Dynamsoft.DCE.Feedback.beepSoundSource = "path/to/beepSound.mp3";
vibrate
Activates device vibration upon invocation.
This method requires Sticky user activation as a security measure. More details can be found on the MDN Web Docs.
static vibrate(): void;
Parameter
None.
Return value
None.
Code Snippet
Dynamsoft.DCE.Feedback.vibrate();
vibrateDuration
Determines the vibration’s duration in milliseconds.
static vibrateDuration: number;
Code Snippet
Dynamsoft.DCE.Feedback.vibrateDuration = 1000;