You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Create a virtual environment. If you already have Python 3.10 or higher installed, you can create a virtual environment using the following commands:
34
-
34
+
35
35
# [Windows](#tab/windows)
36
-
36
+
37
37
```bash
38
38
py -3 -m venv .venv
39
39
.venv\scripts\activate
40
40
```
41
-
41
+
42
42
# [Linux](#tab/linux)
43
-
43
+
44
44
```bash
45
45
python3 -m venv .venv
46
46
source .venv/bin/activate
47
47
```
48
-
48
+
49
49
# [macOS](#tab/macos)
50
-
50
+
51
51
```bash
52
52
python3 -m venv .venv
53
53
source .venv/bin/activate
54
54
```
55
-
55
+
56
56
---
57
-
57
+
58
58
Activating the Python environment means that when you run ```python``` or ```pip``` from the command line, you then use the Python interpreter contained in the ```.venv``` folder of your application. You can use the ```deactivate```command to exit the python virtual environment, and can later reactivate it when needed.
59
59
60
60
> [!TIP]
@@ -102,7 +102,7 @@ For the recommended keyless authentication with Microsoft Entra ID, you need to:
102
102
103
103
```python
104
104
from __future__ import annotations
105
-
105
+
106
106
import os
107
107
import uuid
108
108
import json
@@ -112,7 +112,7 @@ For the recommended keyless authentication with Microsoft Entra ID, you need to:
112
112
import threading
113
113
import numpy as np
114
114
import sounddevice as sd
115
-
115
+
116
116
from collections import deque
117
117
from dotenv import load_dotenv
118
118
from azure.identity import DefaultAzureCredential
@@ -125,22 +125,22 @@ For the recommended keyless authentication with Microsoft Entra ID, you need to:
125
125
from websockets.asyncio.client import HeadersLike
126
126
from websockets.typing import Data
127
127
from websockets.exceptions import WebSocketException
128
-
128
+
129
129
# This is the main function to run the Voice Live API client.
130
-
130
+
131
131
async def main() -> None:
132
132
# Set environment variables or edit the corresponding values here.
133
133
endpoint = os.environ.get("AZURE_VOICE_LIVE_ENDPOINT") or "https://your-endpoint.azure.com/"
134
134
model = os.environ.get("VOICE_LIVE_MODEL") or "gpt-4o"
135
135
api_version = os.environ.get("AZURE_VOICE_LIVE_API_VERSION") or "2025-05-01-preview"
136
136
api_key = os.environ.get("AZURE_VOICE_LIVE_API_KEY") or "your_api_key"
137
-
138
-
# For the recommended keyless authentication, get and
137
+
138
+
# For the recommended keyless authentication, get and
139
139
# use the Microsoft Entra token instead of api_key:
Copy file name to clipboardExpand all lines: articles/ai-services/speech-service/voice-live-how-to.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,10 +30,10 @@ An [Azure AI Foundry resource](../multi-service-resource.md) is required to acce
30
30
31
31
### WebSocket endpoint
32
32
33
-
The WebSocket endpoint for the Voice Live API is `wss://<your-ai-foundry-resource-name>.cognitiveservices.azure.com/voice-agent/realtime?api-version=2025-05-01-preview`.
33
+
The WebSocket endpoint for the Voice Live API is `wss://<your-ai-foundry-resource-name>.cognitiveservices.azure.com/voice-live/realtime?api-version=2025-05-01-preview`.
34
34
The endpoint is the same for all models. The only difference is the required `model` query parameter.
35
35
36
-
For example, an endpoint for a resource with a custom domain would be `wss://<your-ai-foundry-resource-name>.cognitiveservices.azure.com/voice-agent/realtime?api-version=2025-05-01-preview&model=gpt-4o-mini-realtime-preview`
36
+
For example, an endpoint for a resource with a custom domain would be `wss://<your-ai-foundry-resource-name>.cognitiveservices.azure.com/voice-live/realtime?api-version=2025-05-01-preview&model=gpt-4o-mini-realtime-preview`
0 commit comments