vocode-python icon indicating copy to clipboard operation
vocode-python copied to clipboard

Azure TTS voice issue

Open mswoff opened this issue 1 year ago • 3 comments

If I change the voice using AzureSynthesizer(AzureSynthesizerConfig.from_output_device(speaker_output, voice_name="en-GB-RyanNeural")), there seems to be some issue with the playback frequency. This occurs regardless of the voice I change it to.

For comparison, here is a script that uses Azure directly:

import azure.cognitiveservices.speech as speechsdk
import os

speech_config = speechsdk.SpeechConfig(
    subscription=os.environ.get("AZURE_SPEECH_KEY"),
    region=os.environ.get("AZURE_SPEECH_REGION"),
)
audio_config = speechsdk.audio.AudioOutputConfig(use_default_speaker=True)

# The language of the voice that speaks.
speech_config.speech_synthesis_voice_name = (
    "en-GB-RyanNeural"
)

speech_synthesizer = speechsdk.SpeechSynthesizer(
    speech_config=speech_config, audio_config=audio_config
)

speech_synthesis_result = speech_synthesizer.speak_text_async(
    "Hello friend. How are you?"
).get()

And it's noticeably off when I use vocode:

   
 microphone_input, speaker_output = create_streaming_microphone_input_and_speaker_output(use_default_devices=True)

conversation = StreamingConversation(
    output_device=speaker_output,
    transcriber=DeepgramTranscriber(
        DeepgramTranscriberConfig.from_input_device(
            microphone_input, endpointing_config=PunctuationEndpointingConfig()
        )
    ),
    agent=ChatGPTAgent(
        ChatGPTAgentConfig(
            initial_message=BaseMessage(
                text="Hello friend. How are you?"
            ),
            prompt_preamble="Have a friendly conversation.", 
        ),
    ),
    synthesizer=AzureSynthesizer(AzureSynthesizerConfig.from_output_device(speaker_output, voice_name="en-GB-RyanNeural")),
)

await conversation.start()

mswoff avatar Nov 17 '23 13:11 mswoff

I have the same problem - azure TTS seems unusable at this point. Did you solve the issue?

petergerten avatar Jan 30 '24 03:01 petergerten

Hello @petergerten,

We're sorry to hear you're facing similar issues with Azure TTS. To help us understand and resolve this problem more efficiently, could you please provide some additional details? Specifically:

  • Your Environment Details: Can you share the version of the vocode-python package you're using, along with your operating system and Python version?

  • Logs: It would be immensely helpful if you could provide any logs that are generated when you encounter this issue. Logs can often offer critical insights into what might be going wrong.

This information will greatly assist us in diagnosing and addressing the issue more effectively.

Thank you for your cooperation!

arpagon avatar Jan 30 '24 20:01 arpagon

Any updates on this issue? I am unable to get the audio stream from Azure, even through configuration seems to be having no issues. the streaming conversation continues without any issues but audio cant be heard. Am I missing something here?

raikarsagar avatar Mar 21 '24 09:03 raikarsagar

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 21 '24 01:05 github-actions[bot]

This issue has been automatically closed due to inactivity. Thank you for your contributions.

github-actions[bot] avatar May 28 '24 01:05 github-actions[bot]