In this guide, we’ll explore how to add languages to your voice bot.

Azure Transcriber

Azure Transcriber supports a wide range of languages.

Trying Out Languages Online

  1. Visit the Azure Transcriber page.
  2. Note the language codes, which you’ll need for the next step.

Adding Additional Languages in voice_bot.py

To support additional languages in your VoiceBot, update the languages parameter in the AzureTranscriber node. Follow these steps:

import outspeed as sp

@sp.App()
class VoiceBot:
    async def setup(self) -> None:s
      """
      Initialize the VoiceBot.
      """
      # ... existing code ...
      self.transcriber_node = sp.AzureTranscriber(
          languages=["en-US", "fr-FR", "es-ES"]  # Added Spanish (es-ES)
      )
      # ... existing code ...

Steps to Add a New Language:

  1. Identify the Language Code:

  2. Update the languages List:

    • In voice_bot.py, locate the AzureTranscriber initialization within the setup method.
    • Add the new language code to the languages list. For example, to add Spanish, include "es-ES".
  3. Restart the VoiceBot:

    • After updating the code, restart your VoiceBot to apply the changes.
  4. Test the New Language:

    • Verify that the VoiceBot correctly processes audio in the newly added language.

By following these steps, you can easily expand the language capabilities of your VoiceBot to cater to a broader audience.