Skip to content

Commit

Permalink
Add Krisp noice filter to local user microphone track (#14)
Browse files Browse the repository at this point in the history
Add Krisp noise filter
  • Loading branch information
Ocupe authored Oct 7, 2024
1 parent 4cefdac commit 6839ded
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 13 deletions.
7 changes: 7 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { MediaDeviceFailure } from "livekit-client";
import type { ConnectionDetails } from "./api/connection-details/route";
import { NoAgentNotification } from "@/components/NoAgentNotification";
import { CloseIcon } from "@/components/CloseIcon";
import { useKrispNoiseFilter } from "@livekit/components-react/krisp";

export default function Page() {
const [connectionDetails, updateConnectionDetails] = useState<
Expand Down Expand Up @@ -86,6 +87,12 @@ function ControlBar(props: {
onConnectButtonClicked: () => void;
agentState: AgentState;
}) {
// Use the Krisp noise filter to reduce background noise.
const krisp = useKrispNoiseFilter();
useEffect(() => {
krisp.setNoiseFilterEnabled(true);
}, []);

return (
<div className="relative h-[100px]">
<AnimatePresence>
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
"lint": "next lint"
},
"dependencies": {
"@livekit/components-react": "^2.6.1",
"@livekit/components-react": "^2.6.4",
"@livekit/components-styles": "^1.1.3",
"@livekit/krisp-noise-filter": "^0.2.12",
"framer-motion": "^11.9.0",
"livekit-client": "^2.5.5",
"livekit-server-sdk": "^2.6.1",
Expand Down
42 changes: 30 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6839ded

Please sign in to comment.