Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fast-cups-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@livekit/rtc-node': patch
---

Add close() method to AudioResampler to release native handle
8 changes: 8 additions & 0 deletions packages/livekit-rtc/src/audio_resampler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ export class AudioResampler {
return this.#channels;
}

/**
* Releases the underlying native resampler handle. Must be called when
* the resampler is no longer needed to avoid leaking the FD.
*/
close() {
this.#ffiHandle.dispose();
}

/**
* Push audio data into the resampler and retrieve any available resampled data.
*
Expand Down
Loading