> ## Documentation Index
> Fetch the complete documentation index at: https://assemblyai.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Voice Focus

export const ModelBadges = ({models}) => {
  return <div className="flex flex-wrap gap-2 -mt-3 mb-3 not-prose">
      {models.map(model => <span key={model} className="inline-flex items-center rounded-full bg-green-500/15 px-2.5 py-0.5 text-xs font-mono text-green-700 dark:text-green-400 ring-1 ring-inset ring-green-500/30">
          {model}
        </span>)}
    </div>;
};

<ModelBadges models={["universal-3-5-pro", "u3-rt-pro"]} />

Isolate the primary voice and suppress background noise on streaming transcription.

Hear the speaker, not the room. Voice Focus isolates the primary voice and suppresses background chatter, keyboard clicks, fan hum, and room echo before the audio reaches the transcription model.

## Variants

Pick the variant based on how close the speaker is to the microphone.

| Variant    | Value        | When to use                                                                           |
| ---------- | ------------ | ------------------------------------------------------------------------------------- |
| Near field | `near-field` | Headsets, handsets, and other close-talking microphones.                              |
| Far field  | `far-field`  | Conference rooms, drive-thru speakers, laptop mics, and other distant capture setups. |

## Quickstart

Set the `voice_focus` connection parameter when you open the WebSocket. Optionally tune `voice_focus_threshold`, a float between `0.0` and `1.0`, to control how aggressively background audio is suppressed. Higher values are more aggressive.

<Tabs>
  <Tab language="python" title="Python" default>
    ```python theme={null}
    CONNECTION_PARAMS = {
        "sample_rate": 16000,
        "speech_model": "universal-3-5-pro",
        "voice_focus": "near-field",
    }
    ```
  </Tab>

  <Tab language="python-sdk" title="Python SDK">
    ```python theme={null}
    client.connect(
        StreamingParameters(
            sample_rate=16000,
            speech_model="universal-3-5-pro",
            voice_focus="near-field",
        )
    )
    ```
  </Tab>

  <Tab language="javascript" title="Javascript">
    ```javascript theme={null}
    const CONNECTION_PARAMS = {
      sample_rate: 16000,
      speech_model: "universal-3-5-pro",
      voice_focus: "near-field",
    };
    ```
  </Tab>

  <Tab language="javascript-sdk" title="JavaScript SDK">
    ```javascript theme={null}
    const transcriber = client.streaming.transcriber({
      sampleRate: 16_000,
      speechModel: "universal-3-5-pro",
      voiceFocus: "near-field",
    });
    ```
  </Tab>
</Tabs>
