sound = AudioSegment.from_mp3(input_file)
sound.export(output_file, format=“wav”)
r = sr.Recognizer()
with sr.AudioFile(output_file) as source:
audio_data = r.record(source)
text = r.recognize_google(audio_data)
print(text)
Use “Start Process” Activity: Drag and drop a “Start Process” activity onto the workflow.
Set the FileName property to the path of the Python interpreter executable (e.g., C:\Python39\python.exe).
Set the Arguments property to the full path of your Python script file (e.g., "C:\Path\to\your\audio_to_text.py").
Capture Output: Use the “Invoke Python Method” activity to capture the output of the Python script.
Set the MethodName property to "GetConsoleOutput".
Set the TargetObject property to the output of the “Start Process” activity.
Set the Result property to a variable (e.g., pythonOutput).
Log Output: Add a “Log Message” activity to display the captured output.
Set the Message property to pythonOutput.
Run the Workflow: Run the workflow to execute the Python script and capture the output.The pythonOutput variable will contain the text printed by the Python script