Skip to content

Commit 1393394

Browse files
authored
Add Voice Live SDK (preview) (#42080)
Introduces a new client library that enables real-time, speech-to-speech interactions with Azure AI Voice Live, supporting low-latency audio streaming and conversational experiences. API view: https://spa.apiview.dev/review/8129e6c762924e02836a2e79b2b480a6?activeApiRevisionId=fb791ee09ebc438ea457deff338b865d
1 parent 351d5a5 commit 1393394

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+12663
-4
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@
260260
# ServiceLabel: %AI Projects %Service Attention
261261
/sdk/ai/azure-ai-projects/ @dargilco @jhakulin @trangevi @glharper @nick863 @howieleung
262262

263+
# PRLabel: %AI Voice Live
264+
# ServiceLabel: %AI Voice Live %Service Attention
265+
/sdk/ai/azure-ai-voicelive/ @rhurey @xitzhang
266+
263267

264268
# PRLabel: %HDInsight
265269
/sdk/hdinsight/ @idear1203

.vscode/cspell.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@
150150
"conda/conda-recipes/msrest/meta.yaml",
151151
"conda/conda-recipes/uamqp/meta.yaml",
152152
"conda/conda-releaselogs/azure-mgmt.md",
153-
".github/workflows/azure-sdk-tools.yml"
153+
".github/workflows/azure-sdk-tools.yml",
154+
"sdk/ai/azure-ai-voicelive/azure/ai/voicelive/models/_*.py",
155+
"sdk/ai/azure-ai-voicelive/samples/**"
154156
],
155157
"words": [
156158
"msedge",
@@ -515,7 +517,17 @@
515517
"WINDOWSVMIMAGE",
516518
"LINUXVMIMAGE",
517519
"MACVMIMAGE",
518-
"myuseragent"
520+
"myuseragent",
521+
"viseme",
522+
"Viseme",
523+
"VISEME",
524+
"ulaw",
525+
"ULAW",
526+
"logprobs",
527+
"pyaudio",
528+
"PyAudio",
529+
"libasound",
530+
"ingraph"
519531
],
520532
"overrides": [
521533
{
@@ -2054,6 +2066,10 @@
20542066
"TPEG",
20552067
"Hundredkm"
20562068
]
2069+
},
2070+
{
2071+
"filename": "sdk/ai/azure-ai-voicelive/**",
2072+
"words": ["viseme","VISEME","ulaw","ULAW","logprobs","pyaudio","PyAudio","libasound"]
20572073
}
20582074
],
20592075
"allowCompoundWords": true

eng/pipelines/templates/jobs/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ jobs:
144144
image: $(LINUXVMIMAGE)
145145
os: linux
146146

147+
variables:
148+
# default to true just in this job until #42714 can be completed
149+
InstallPortAudio: true
150+
147151
steps:
148152
- template: /eng/pipelines/templates/steps/download-package-artifacts.yml
149153

@@ -202,6 +206,10 @@ jobs:
202206
dependsOn:
203207
- 'Build_Extended'
204208

209+
variables:
210+
# default to true just in this job until #42714 can be completed
211+
InstallPortAudio: true
212+
205213
pool:
206214
name: $(LINUXPOOL)
207215
image: $(LINUXVMIMAGE)

eng/pipelines/templates/steps/run_mypy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ steps:
1010
- task: UsePythonVersion@0
1111
displayName: 'Use Python 3.9'
1212
inputs:
13-
versionSpec: '3.9'
13+
versionSpec: '3.9'
1414
condition: and(succeededOrFailed(), ne(variables['Skip.MyPy'],'true'))
1515

1616
- script: |
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Azure VoiceLive Configuration
2+
# Copy this file to .env and fill in your values
3+
4+
# Required credentials
5+
AZURE_VOICELIVE_KEY=your-voicelive-api-key
6+
AZURE_VOICELIVE_ENDPOINT=wss://api.voicelive.com/v1
7+
8+
# Optional configuration
9+
VOICELIVE_MODEL=gpt-4o-realtime-preview
10+
VOICELIVE_VOICE=alloy
11+
VOICELIVE_INSTRUCTIONS=You are a helpful assistant. Keep your responses concise.
12+
13+
# For audio samples
14+
AUDIO_FILE=path/to/your/test_audio.wav
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Release History
2+
3+
## 1.0.0b1 (Unreleased)
4+
5+
### Features Added
6+
7+
- Added WebSocket connection support through `connect()`.
8+
- Added `WebsocketConnectionOptions` to configure WebSocket connections.
9+
- Added `VoiceLiveConnection` for managing WebSocket connections.
10+
- Added WebSocket-based examples in the samples directory.
11+
12+
### Other Changes
13+
14+
- Added `websockets` extra in `setup.py` to install WebSocket dependencies.
15+
- Initial preview release.

sdk/ai/azure-ai-voicelive/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (c) Microsoft Corporation.
2+
3+
MIT License
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include *.md
2+
include LICENSE
3+
include azure/ai/voicelive/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
6+
include azure/__init__.py
7+
include azure/ai/__init__.py

0 commit comments

Comments
 (0)