diff --git a/docs/how-to/client/managing-devices.mdx b/docs/how-to/client/managing-devices.mdx index 1572a08..cdad436 100644 --- a/docs/how-to/client/managing-devices.mdx +++ b/docs/how-to/client/managing-devices.mdx @@ -258,6 +258,53 @@ export function MicrophoneControl() { } ``` +## Audio processing: noise cancellation and auto gain control + +When capturing a microphone, the browser (Web) or OS (Mobile) applies audio processing — **echo cancellation**, **noise suppression** (noise cancellation) and **auto gain control** — to make speech clearer. These are enabled by default and are the right choice for most voice and meeting use cases. + +Turn them off only when you need the raw, unprocessed signal — for example capturing music or an instrument, or running your own audio processing — since these filters can distort non-speech audio. + + + + +On Web, audio processing follows the browser's defaults (noise suppression, auto gain control and echo cancellation are on by default). To set them explicitly, pass [`constraints`](../../api/web/interfaces/FishjamProviderProps#constraints) to `FishjamProvider`. The `audio` field accepts standard [`MediaTrackConstraints`](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints). + +```tsx +import React from "react"; +import { FishjamProvider } from "@fishjam-cloud/react-client"; + +export function App({ fishjamId }: { fishjamId: string }) { + return ( + + {/* your app */} + + ); +} +``` + +To capture raw audio (for example, music), set `echoCancellation`, `noiseSuppression`, and `autoGainControl` to `false` instead. + +:::note +These constraints are applied when `FishjamProvider` creates the microphone track. `selectMicrophone` and `startMicrophone` reuse the same constraints — they don't accept per-call overrides. +::: + + + + +On Mobile, echo cancellation, noise suppression and auto gain control are enabled by default in the native audio pipeline and aren't currently configurable from JavaScript. + + + + ## Managing Permissions (Mobile only) The SDK provides built-in hooks for querying and requesting device permissions: `useCameraPermissions` and `useMicrophonePermissions` from `@fishjam-cloud/react-native-client`.