# Microsoft Azure (/en/ai/models/tts/microsoft)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

Microsoft Azure offers neural voices in multiple languages with options for different speaking styles and emotions, providing enterprise-grade text-to-speech capabilities with high-quality audio output.

### Sample configuration [#sample-configuration]

The following examples show how to configure Microsoft Azure TTS when starting a conversational AI agent.

<Tabs defaultValue="python" groupId="ai-sdk-language">
  <TabsList>
    <TabsTrigger value="python">
      Python SDK
    </TabsTrigger>

    <TabsTrigger value="typescript">
      TypeScript SDK
    </TabsTrigger>

    <TabsTrigger value="go">
      Go SDK
    </TabsTrigger>

    <TabsTrigger value="rest-api">
      REST API
    </TabsTrigger>
  </TabsList>

  <TabsContent value="python">
    ```python
    from agora_agent import Agent
    from agora_agent.agentkit.vendors import MicrosoftTTS

    # client is your configured Agora client
    agent = (
        Agent(client)
        .with_stt(...)  # configure your STT vendor
        .with_llm(...)  # configure your LLM vendor
        .with_tts(MicrosoftTTS(
            key='your-azure-key',
            region='eastus',
            voice_name='en-US-AndrewMultilingualNeural',
            speed=1.0,
            volume=70,
        ))
    )
    ```
  </TabsContent>

  <TabsContent value="typescript">
    ```typescript
    import { Agent, MicrosoftTTS } from 'agora-agents';

    // client is your configured Agora client
    const agent = new Agent({ client })
      .withStt(/* configure your STT vendor */)
      .withLlm(/* configure your LLM vendor */)
      .withTts(new MicrosoftTTS({
        key: 'your-azure-key',
        region: 'eastus',
        voiceName: 'en-US-AndrewMultilingualNeural',
        speed: 1.0,
        volume: 70,
      }));
    ```
  </TabsContent>

  <TabsContent value="go">
    ```go
    import "github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"

    // client is your configured Agora client
    agent := agentkit.NewAgent(client).WithStt(/* configure your STT vendor */).
      WithLlm(/* configure your LLM vendor */).
      WithTts(
        vendors.NewMicrosoftTTS(vendors.MicrosoftTTSOptions{
            Key:       "your-azure-key",
            Region:    "eastus",
            VoiceName: "en-US-AndrewMultilingualNeural",
            Speed:     agora.Float64(1.0),
            Volume:    agora.Float64(70),
        }),
    )
    ```
  </TabsContent>

  <TabsContent value="rest-api">
    Use the following `tts` configuration in your request:

    ```json
    "tts": {
      "vendor": "microsoft",
      "params": {
        "key": "<your_microsoft_key>",
        "region": "eastus",
        "voice_name": "en-US-AndrewMultilingualNeural",
        "speed": 1.0,
        "volume": 70,
        "sample_rate": 24000
      }
    }
    ```
  </TabsContent>
</Tabs>

<CalloutContainer type="warning">
  <CalloutTitle>
    Caution
  </CalloutTitle>

  <CalloutDescription>
    The parameters listed on this page are validated for use with Conversational AI Engine. Required parameters must be provided as documented. Any additional parameters are passed through directly to the underlying vendor without validation. For advanced configuration options, voice galleries, and detailed parameter descriptions, see the [Microsoft Azure TTS documentation](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/text-to-speech).
  </CalloutDescription>
</CalloutContainer>

### Key parameters [#key-parameters]

<ParameterList title="params" required="true">
  <Parameter name="key" type="string" required="true">
    The API key used for authentication. Get your API key from the [Azure Portal](https://portal.azure.com/).
  </Parameter>

  <Parameter name="region" type="string" required="true">
    The Azure region where the speech service is hosted (For example, `eastus`, `westus2`).
  </Parameter>

  <Parameter name="voice_name" type="string" required="true">
    The identifier for the selected voice for speech synthesis. See [available voices](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=tts) for options.
  </Parameter>

  <Parameter name="speed" type="number" defaultValue="1.0" required="false">
    Speaking rate of the text. Values between `0.5` and `2.0` times the original audio speed.
  </Parameter>

  <Parameter name="volume" type="number" defaultValue="100" required="false">
    Audio volume as a number between `0.0` and `100.0`, where `0.0` is quietest and `100.0` is loudest.
  </Parameter>

  <Parameter name="sample_rate" type="integer" defaultValue="24000" required="false">
    Audio sampling rate in Hz. Common values: `16000`, `24000`, `48000`.
  </Parameter>
</ParameterList>
