Spaces:
Runtime error
Runtime error
Update app.py
Browse files216 unmodified lines217218219220221222223224225226227228229230231216 unmodified lines# Process the resultif result:# Assuming the result is a tuple containing audio data and translated textaudio_data, translated_text = resultif audio_data:# Assuming audio_data is a tuple containing sample rate and audio numpy arraysample_rate, audio_numpy_array = audio_dataaudio_file_path = save_audio(sample_rate, audio_numpy_array) # Save the audio filereturn audio_file_path, translated_textexcept Exception as e:return None, f"Error in text-to-speech conversion: {str(e)}"216 unmodified lines217218219220221222223224225226227228229230216 unmodified lines# Process the resultif result:for item in result:if isinstance(item, str):if item.endswith('.mp3') and not audio_file_path:audio_file_path = item # Store the first audio file pathelse:translated_text += item + " " # Concatenate the translated textreturn audio_file_path, translated_text.strip()except Exception as e:return None, f"Error in text-to-speech conversion: {str(e)}"
app.py+8-9