You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DetectionEvents.ts 3.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. export enum DetectionEvents {
  2. /**
  3. * Event triggered by a audio detector indicating that its active state has changed from active to inactive or vice
  4. * versa.
  5. * @event
  6. * @type {boolean} - true when service has changed to active false otherwise.
  7. */
  8. DETECTOR_STATE_CHANGE = 'detector_state_change',
  9. /** Event triggered by {@link NoAudioSignalDetector} when the local audio device associated with a JitsiConference
  10. * starts receiving audio levels with the value of 0 meaning no audio is being captured on that device, or when
  11. * it starts receiving audio levels !== 0 after being in a state of no audio.
  12. * @event
  13. * @type {boolean} - true when the current conference audio track has audio input false otherwise.
  14. */
  15. AUDIO_INPUT_STATE_CHANGE = 'audio_input_state_changed',
  16. /** Event triggered by NoAudioSignalDetector when the local audio device associated with a JitsiConference goes silent
  17. * for a period of time, meaning that the device is either broken or hardware/software muted.
  18. * @event
  19. * @type {void}
  20. */
  21. NO_AUDIO_INPUT = 'no_audio_input_detected',
  22. /**
  23. * Event generated by {@link VADNoiseDetection} when the tracked device is considered noisy.
  24. * @event
  25. * @type {Object}
  26. */
  27. VAD_NOISY_DEVICE = 'detection.vad_noise_device',
  28. /**
  29. * Event generated by VADReportingService when if finishes creating a VAD report for the monitored devices.
  30. * The generated objects are of type Array<Object>, one score for each monitored device.
  31. * @event VAD_REPORT_PUBLISHED
  32. * @type Array<Object> with the following structure:
  33. * @property {Date} timestamp - Timestamp at which the compute took place.
  34. * @property {number} avgVAD - Average VAD score over monitored period of time.
  35. * @property {string} deviceId - Associate local audio device ID.
  36. */
  37. VAD_REPORT_PUBLISHED = 'vad-report-published',
  38. /**
  39. * Event generated by {@link TrackVADEmitter} when PCM sample VAD score is available.
  40. *
  41. * @event
  42. * @type {Object}
  43. * @property {Date} timestamp - Exact time at which processed PCM sample was generated.
  44. * @property {number} score - VAD score on a scale from 0 to 1 (i.e. 0.7)
  45. * @property {Float32Array} pcmData - Raw PCM data with which the VAD score was calculated.
  46. * @property {string} deviceId - Device id of the associated track.
  47. */
  48. VAD_SCORE_PUBLISHED = 'detection.vad_score_published',
  49. /**
  50. * Event generated by {@link VADTalkMutedDetection} when a user is talking while the mic is muted.
  51. *
  52. * @event
  53. * @type {Object}
  54. */
  55. VAD_TALK_WHILE_MUTED = 'detection.vad_talk_while_muted'
  56. };
  57. // exported for backward compatibility
  58. export const DETECTOR_STATE_CHANGE = DetectionEvents.DETECTOR_STATE_CHANGE;
  59. export const AUDIO_INPUT_STATE_CHANGE = DetectionEvents.AUDIO_INPUT_STATE_CHANGE;
  60. export const NO_AUDIO_INPUT = DetectionEvents.NO_AUDIO_INPUT;
  61. export const VAD_NOISY_DEVICE = DetectionEvents.VAD_NOISY_DEVICE;
  62. export const VAD_REPORT_PUBLISHED = DetectionEvents.VAD_REPORT_PUBLISHED;
  63. export const VAD_SCORE_PUBLISHED = DetectionEvents.VAD_SCORE_PUBLISHED;
  64. export const VAD_TALK_WHILE_MUTED = DetectionEvents.VAD_TALK_WHILE_MUTED;