Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/silent-pots-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-plugins-azure": patch
---

add speech endpoint in azure ctor and azure speech sdk version upgrade
10 changes: 10 additions & 0 deletions livekit-plugins/livekit-plugins-azure/livekit/plugins/azure/stt.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

import azure.cognitiveservices.speech as speechsdk # type: ignore

from .log import logger


@dataclass
class STTOptions:
Expand Down Expand Up @@ -52,6 +54,7 @@ def __init__(
speech_key: str | None = None,
speech_region: str | None = None,
speech_host: str | None = None,
speech_endpoint: str | None = None,
speech_auth_token: str | None = None,
sample_rate: int = 16000,
num_channels: int = 1,
Expand Down Expand Up @@ -85,11 +88,17 @@ def __init__(
speech_host
or (speech_key and speech_region)
or (speech_auth_token and speech_region)
or (speech_endpoint and speech_key)
):
raise ValueError(
"AZURE_SPEECH_HOST or AZURE_SPEECH_KEY and AZURE_SPEECH_REGION or speech_auth_token and AZURE_SPEECH_REGION must be set"
)

if speech_region and speech_endpoint:
logger.warning(
"speech_region and speech_endpoint are both set. Using speech_endpoint."
)
speech_region = None
if language:
languages = [language]

Expand All @@ -98,6 +107,7 @@ def __init__(
speech_region=speech_region,
speech_host=speech_host,
speech_auth_token=speech_auth_token,
speech_endpoint=speech_endpoint,
languages=languages,
sample_rate=sample_rate,
num_channels=num_channels,
Expand Down
2 changes: 1 addition & 1 deletion livekit-plugins/livekit-plugins-azure/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
python_requires=">=3.9.0",
install_requires=[
"livekit-agents>=0.12.16,<1.0.0",
"azure-cognitiveservices-speech>=1.41.0",
"azure-cognitiveservices-speech>=1.43.0",
],
package_data={},
project_urls={
Expand Down
Loading