This commit is contained in:
Kwindla Hultman Kramer
2024-05-29 23:41:35 -07:00
parent 920745345a
commit d5f106ae19
3 changed files with 4 additions and 5 deletions

View File

@@ -23,7 +23,7 @@ async-timeout==4.0.3
# via aiohttp # via aiohttp
attrs==23.2.0 attrs==23.2.0
# via aiohttp # via aiohttp
av==12.0.0 av==12.1.0
# via faster-whisper # via faster-whisper
azure-cognitiveservices-speech==1.37.0 azure-cognitiveservices-speech==1.37.0
# via pipecat-ai (pyproject.toml) # via pipecat-ai (pyproject.toml)

View File

@@ -35,7 +35,7 @@ Website = "https://pipecat.ai"
[project.optional-dependencies] [project.optional-dependencies]
anthropic = [ "anthropic~=0.25.7" ] anthropic = [ "anthropic~=0.25.7" ]
azure = [ "azure-cognitiveservices-speech~=1.37.0" ] azure = [ "azure-cognitiveservices-speech~=1.37.0" ]
cartesia = [ "numpy", "sounddevice", "cartesia" ] cartesia = [ "numpy~=1.26.0", "sounddevice", "cartesia" ]
daily = [ "daily-python~=0.9.0" ] daily = [ "daily-python~=0.9.0" ]
examples = [ "python-dotenv~=1.0.0", "flask~=3.0.3", "flask_cors~=4.0.1" ] examples = [ "python-dotenv~=1.0.0", "flask~=3.0.3", "flask_cors~=4.0.1" ]
fal = [ "fal-client~=0.4.0" ] fal = [ "fal-client~=0.4.0" ]

View File

@@ -5,7 +5,6 @@
# #
import aiohttp import aiohttp
import json
from typing import AsyncGenerator from typing import AsyncGenerator
@@ -33,8 +32,8 @@ class DeepgramTTSService(TTSService):
async def run_tts(self, text: str) -> AsyncGenerator[Frame, None]: async def run_tts(self, text: str) -> AsyncGenerator[Frame, None]:
logger.info(f"Running Deepgram TTS for {text}") logger.info(f"Running Deepgram TTS for {text}")
base_url = "https://api.deepgram.com/v1/speak" base_url = "https://api.deepgram.com/v1/speak"
request_url = f"{base_url}?model={ request_url = f"{base_url}?model = {
self._voice}&encoding=linear16&container=none&sample_rate=16000" self._voice} & encoding = linear16 & container = none & sample_rate = 16000"
headers = {"authorization": f"token {self._api_key}"} headers = {"authorization": f"token {self._api_key}"}
body = {"text": text} body = {"text": text}