Spaces:
Sleeping
Sleeping
Download translations/utils/utils_functions.py from FerdinandPyCode/lambda_hf_v2: direct link, hf CLI and curl.
- Browser
- Download file 454 Bytes
-
https://huggingface.co/spaces/FerdinandPyCode/lambda_hf_v2/resolve/main/translations/utils/utils_functions.py
- Command line
-
hf download hf://spaces/FerdinandPyCode/lambda_hf_v2/translations/utils/utils_functions.py
-
curl -L -o utils_functions.py https://huggingface.co/spaces/FerdinandPyCode/lambda_hf_v2/resolve/main/translations/utils/utils_functions.py
454 Bytes
| import speech_recognition as sr | |
| def startConvertion(path = 'ml.wav',lang = 'fr-FR'): | |
| r = sr.Recognizer() | |
| text = '' | |
| with sr.AudioFile(path) as source: | |
| print('Fetching File') | |
| audio_text = r.listen(source) | |
| try: | |
| print('Converting audio transcripts into text ...') | |
| text = r.recognize_google(audio_text, language = lang) | |
| print(text) | |
| except: | |
| pass | |
| return text | |