Skip to content

Commit 26be87f

Browse files
Disconnect existing source and destination nodes (#3121)
* Disconnect existing source and destination nodes
1 parent 43989b4 commit 26be87f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
- Added new attributes signalingCloseCode, signalingCloseReason, and signalingCloseWasClean to signalingDropped events. These are not always guaranteed to be set.
2020
- Reset additional internal state on reconnect to fix issues with receiving content share in replica meetings when using the priority policy.
2121
- Avoid trying to send leave message on refresh, and just let browser close with expected 1001 Websocket status code.
22+
- Fixed voice focus webaudio media stream clean up logic.
2223
- Avoid Chrome ERROR log that starts with "A BUNDLE group contains a codec collision for payload_type=..." by ensuring all payload type have same parameters on SDP.
2324

2425
### Fixed

libs/voicefocus/voicefocus.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,14 +332,16 @@ class VoiceFocus {
332332
.then(() => new (this.nodeConstructor)(context, Object.assign(Object.assign({}, this.nodeOptions), { processorOptions })));
333333
}
334334
applyToStream(stream, context, options, useExistingNode = false) {
335-
var _a;
335+
var _a, _b, _c;
336336
return __awaiter(this, void 0, void 0, function* () {
337337
if (this.internal.isDestroyed) {
338338
throw new Error("Unable to apply stream because VoiceFocus worker has been destroyed");
339339
}
340+
(_a = this.internal.sourceNode) === null || _a === void 0 ? void 0 : _a.disconnect();
341+
(_b = this.internal.destinationNode) === null || _b === void 0 ? void 0 : _b.disconnect();
340342
let voiceFocusNode;
341343
if (useExistingNode && this.internal.voiceFocusNode && this.internal.voiceFocusNode.isEnabled()) {
342-
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.info("Re-using existing voice focus node");
344+
(_c = this.logger) === null || _c === void 0 ? void 0 : _c.info("Re-using existing voice focus node");
343345
voiceFocusNode = this.internal.voiceFocusNode;
344346
}
345347
else {

0 commit comments

Comments
 (0)