opensips-js 0.1.10 → 0.1.12

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.
package/dist/index.d.ts CHANGED
@@ -69,9 +69,15 @@ declare class AudioModule {
69
69
  private metricConfig;
70
70
  private activeStreamValue;
71
71
  private initialStreamValue;
72
+ private noiseReduction;
73
+ private vadSessions;
74
+ private vadSessionsState;
75
+ private vadIntervals;
76
+ private vadMrsIntervals;
72
77
  private VUMeter;
73
78
  managedAudioContext: ManagedAudioContext;
74
79
  constructor(context: OpenSIPSJS);
80
+ private processVADConfiguration;
75
81
  get sipOptions(): {
76
82
  mediaConstraints: {
77
83
  video: boolean;
@@ -81,6 +87,12 @@ declare class AudioModule {
81
87
  deviceId: {
82
88
  exact: string;
83
89
  };
90
+ echoCancellation: boolean;
91
+ echoCancellationType: string;
92
+ noiseSuppression: boolean;
93
+ autoGainControl: boolean;
94
+ sampleRate: number;
95
+ latency: number;
84
96
  };
85
97
  video: boolean;
86
98
  };
@@ -128,6 +140,12 @@ declare class AudioModule {
128
140
  deviceId: {
129
141
  exact: string;
130
142
  };
143
+ echoCancellation: boolean;
144
+ echoCancellationType: string;
145
+ noiseSuppression: boolean;
146
+ autoGainControl: boolean;
147
+ sampleRate: number;
148
+ latency: number;
131
149
  };
132
150
  video: boolean;
133
151
  };
@@ -164,6 +182,7 @@ declare class AudioModule {
164
182
  private updateCallStatus;
165
183
  private removeCallStatus;
166
184
  private addRoom;
185
+ private setupActiveStream;
167
186
  private getActiveStream;
168
187
  setMicrophone(dId: string): Promise<void>;
169
188
  private setActiveStream;
@@ -172,6 +191,13 @@ declare class AudioModule {
172
191
  private deleteRoomIfEmpty;
173
192
  private checkInitialized;
174
193
  private muteReconfigure;
194
+ /**
195
+ * Monitors background noise while user is not speaking.
196
+ * Calls `onNoiseDetected()` or `onNoiseStop()` when mode should switch.
197
+ */
198
+ private startNoiseMonitor;
199
+ private processVAD;
200
+ private stopSessionVad;
175
201
  private roomReconfigure;
176
202
  private doConference;
177
203
  private processCallerMute;
@@ -333,6 +359,8 @@ declare type changeIsMutedListener = (value: boolean) => void
333
359
 
334
360
  declare type changeMuteWhenJoinListener = (value: boolean) => void
335
361
 
362
+ declare type changeNoiseReductionStateListener = (event: NoiseReductionStateEventType) => void
363
+
336
364
  declare type changeVideoStateListener = (state: boolean) => void
337
365
 
338
366
  declare type ChangeVolumeEventType = {
@@ -746,6 +774,21 @@ declare interface MSRPSessionExtended extends MSRPSession_2 {
746
774
 
747
775
  declare type MSRPSessionListener = IncomingMSRPSessionListener | OutgoingMSRPSessionListener;
748
776
 
777
+ declare type NoiseReductionMode = 'disabled' | 'enabled' | 'dynamic'
778
+
779
+ declare interface NoiseReductionOptions {
780
+ mode: NoiseReductionMode,
781
+ vadConfig?: Partial<VADOptions>
782
+ noiseThreshold?: number
783
+ checkEveryMs?: number
784
+ noiseCheckInterval?: number
785
+ }
786
+
787
+ declare type NoiseReductionStateEventType = {
788
+ sessionId: string
789
+ enabled: boolean
790
+ }
791
+
749
792
  declare type OnTransportCallback = (parsed: object, message: string) => void
750
793
 
751
794
  declare interface OpenSIPSEventMap extends UAEventMap {
@@ -776,6 +819,7 @@ declare interface OpenSIPSEventMap extends UAEventMap {
776
819
  changeCallTime: changeCallTimeListener
777
820
  changeCallMetrics: changeCallMetricsListener
778
821
  changeCallVolume: changeCallVolumeListener
822
+ changeNoiseReductionState: changeNoiseReductionStateListener
779
823
  newMSRPMessage: MSRPMessageListener
780
824
  newMSRPSession: MSRPSessionListener
781
825
  // JANUS
@@ -932,6 +976,7 @@ declare interface TriggerListenerOptions {
932
976
  declare type UAConfigurationExtended = UAConfiguration & {
933
977
  reconnectionAttemptsLimit?: number
934
978
  overrideUserAgent?: (userAgent: string) => string
979
+ noiseReductionOptions?: NoiseReductionOptions
935
980
  onTransportCallback?: OnTransportCallback
936
981
  }
937
982
 
@@ -1022,6 +1067,14 @@ declare interface UAExtendedInterface_2 extends UA {
1022
1067
 
1023
1068
  declare type updateRoomListener = (value: RoomChangeEmitType) => void
1024
1069
 
1070
+ declare interface VADOptions {
1071
+ model: 'v5' | 'legacy'
1072
+ positiveSpeechThreshold: number
1073
+ negativeSpeechThreshold: number
1074
+ minSpeechFrames: number
1075
+ preSpeechPadFrames: number
1076
+ }
1077
+
1025
1078
  declare interface VideoConferenceJoinOptions {
1026
1079
  eventHandlers: Array<unknown>;
1027
1080
  extraHeaders: Array<string>;