Downloads · 30 days
0
Allister7274/GIDEONunit
GIDEONunit is a machine learning model from Allister7274. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Adio-To-Text Text-To-Audio Voice-Analsis import speechrecognition as sr class GIDEONunit: def init(self): pass def transcribeaudio(self, audiofile): recognizer = sr.Recognizer() with sr.AudioFile(audiofile) as source:…
Downloads · 30 days
0
Access
Public
Updated Jun 5, 2024
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 58%
From the Hugging Face model README
Adio-To-Text Text-To-Audio Voice-Analsis import speech_recognition as sr class GIDEONunit: def init(self): pass def transcribe_audio(self, audio_file): recognizer = sr.Recognizer()
with sr.AudioFile(audio_file) as source: audio_data = recognizer.record(source) try:
text = recognizer.recognize_google(audio_data) return text except sr.UnknownValueError: print("GIDEONunit could not understand the audio.") return "" except sr.RequestError as e: print(f"Could not request results from Google Speech Recognition service; {e}") return "" def create_documentation(self, audio_file, output_file):
text = self.transcribe_audio(audio_file)
with open(output_file, "w") as f: f.write(text)
if name == "main": gideon = GIDEONunit() audio_file = "input_audio.wav" output_file = "output_documentation.txt" gideon.create_documentation(audio_file, output_file)