Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

DetectionEvents.ts 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. export enum DetectionEvents {
  2. /** Event triggered by {@link NoAudioSignalDetector} when the local audio device associated with a JitsiConference
  3. * starts receiving audio levels with the value of 0 meaning no audio is being captured on that device, or when
  4. * it starts receiving audio levels !== 0 after being in a state of no audio.
  5. * @event
  6. * @type {boolean} - true when the current conference audio track has audio input false otherwise.
  7. */
  8. AUDIO_INPUT_STATE_CHANGE = 'audio_input_state_changed',
  9. /**
  10. * Event triggered by a audio detector indicating that its active state has changed from active to inactive or vice
  11. * versa.
  12. * @event
  13. * @type {boolean} - true when service has changed to active false otherwise.
  14. */
  15. DETECTOR_STATE_CHANGE = 'detector_state_change',
  16. /** Event triggered by NoAudioSignalDetector when the local audio device associated with a JitsiConference goes
  17. * silent 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;