( deviceId: string | null, micSettings: LiveRoomMicSettings, micSettingSupport: LiveRoomMicSettingSupport, )
| 312 | }); |
| 313 | |
| 314 | const buildAudioConstraints = ( |
| 315 | deviceId: string | null, |
| 316 | micSettings: LiveRoomMicSettings, |
| 317 | micSettingSupport: LiveRoomMicSettingSupport, |
| 318 | ): MediaTrackConstraints => { |
| 319 | const constraints: MediaTrackConstraints = deviceId |
| 320 | ? { deviceId: { exact: deviceId } } |
| 321 | : {}; |
| 322 | |
| 323 | if (micSettingSupport.echoCancellation) { |
| 324 | constraints.echoCancellation = micSettings.echoCancellation; |
| 325 | } |
| 326 | |
| 327 | if (micSettingSupport.noiseSuppression) { |
| 328 | constraints.noiseSuppression = micSettings.noiseSuppression; |
| 329 | } |
| 330 | |
| 331 | if (micSettingSupport.autoGainControl) { |
| 332 | constraints.autoGainControl = micSettings.autoGainControl; |
| 333 | } |
| 334 | |
| 335 | return constraints; |
| 336 | }; |
| 337 | |
| 338 | const getMicSettingsSignature = (micSettings: LiveRoomMicSettings): string => |
| 339 | JSON.stringify(micSettings); |
no outgoing calls
no test coverage detected