Created
August 31, 2021 20:18
-
-
Save Emgicraft/0afe8ab55b954caa9b6f28355b66ba01 to your computer and use it in GitHub Desktop.
Transcribe el contenido de una archivo de audio a texto. Soporta hasta audios de 5 minutos.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Audio a texto. | |
El tipo de archivo tiene que ser .wav | |
@author: Magh | |
""" | |
import speech_recognition as sr | |
r = sr.Recognizer() | |
#r.energy_threshold = 300 | |
#Archivo de audio de ejemplo: | |
audio = sr.AudioFile("AUDIO 1UNIDAD 3.wav") | |
with audio as source: | |
audio = r.record(source, duration=48.0) # duración: 48s | |
resultado = r.recognize_google(audio_data=audio, language="en-US") # idioma: inglés-US | |
print(resultado) # Muestra el texto procesado del audio. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment