remove pyq goodbye model and rime synthesizer and fix environment loading
This commit is contained in:
parent
a93bfc1ec9
commit
1dc7bc74c3
28 changed files with 143 additions and 285 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
from typing import Optional
|
||||
import azure.cognitiveservices.speech as speechsdk
|
||||
from pydub import AudioSegment
|
||||
from vocode import getenv
|
||||
|
||||
from vocode.turn_based.synthesizer.base_synthesizer import BaseSynthesizer
|
||||
|
||||
|
|
@ -15,8 +15,8 @@ class AzureSynthesizer(BaseSynthesizer):
|
|||
):
|
||||
self.sampling_rate = sampling_rate
|
||||
speech_config = speechsdk.SpeechConfig(
|
||||
subscription=os.getenv("AZURE_SPEECH_KEY", api_key),
|
||||
region=os.getenv("AZURE_SPEECH_REGION", region),
|
||||
subscription=getenv("AZURE_SPEECH_KEY", api_key),
|
||||
region=getenv("AZURE_SPEECH_REGION", region),
|
||||
)
|
||||
if self.sampling_rate == 44100:
|
||||
speech_config.set_speech_synthesis_output_format(
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import io
|
||||
import os
|
||||
from typing import Optional
|
||||
from pydub import AudioSegment
|
||||
import requests
|
||||
from vocode import getenv
|
||||
from vocode.turn_based.synthesizer.base_synthesizer import BaseSynthesizer
|
||||
|
||||
ELEVEN_LABS_BASE_URL = "https://api.elevenlabs.io/v1/"
|
||||
|
|
@ -11,7 +11,7 @@ ELEVEN_LABS_BASE_URL = "https://api.elevenlabs.io/v1/"
|
|||
class ElevenLabsSynthesizer(BaseSynthesizer):
|
||||
def __init__(self, voice_id: str, api_key: Optional[str] = None):
|
||||
self.voice_id = voice_id
|
||||
self.api_key = os.getenv("ELEVEN_LABS_API_KEY", api_key)
|
||||
self.api_key = getenv("ELEVEN_LABS_API_KEY", api_key)
|
||||
|
||||
def synthesize(self, text: str) -> AudioSegment:
|
||||
url = ELEVEN_LABS_BASE_URL + f"text-to-speech/{self.voice_id}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue