Complete the following Python function to correctly configure and utilize the Speech Translation SDK:
speech_key = os.environ['SPEECH__SUBSCRIPTION__KEY']
service_region = os.environ['SPEECH__SERVICE__REGION']
def translate_speech():
translation_config = speechsdk.translation.SpeechTranslationConfig(
subscription=speech_key, region=service_region)
translation_config.speech_recognition_language = {{slot1}}
languages = {{slot2}}
for language in languages:
translation_config.add_target_language(language)
audio_config = speechsdk.audio.AudioConfig(use_default_microphone=True)
recognizer = speechsdk.translation.{{slot3}}(
speech_config=translation_config, audio_config=audio_config)
result = recognizer.recognize_once()
if result.reason == speechsdk.ResultReason.TranslatedSpeech:
append_to_transcript_file(result.text, "en")
for language in result.translations:
append_to_transcript_file(result.translations[language], language)Correct slot values