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.js 2.5KB

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