Advertisement
Fsoky

Из голоса в текст | Fsoky

Aug 6th, 2020
561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. import speech_recognition as sr
  2.  
  3. def record_volume():
  4.     r = sr.Recognizer()
  5.  
  6.     with sr.Microphone(device_index = 1) as source:
  7.         print('Слушаю...')
  8.         audio = r.listen(source)
  9.  
  10.     query = r.recognize_google(audio, language = 'ru-RU')
  11.     print(f'Вы сказали: {query.lower()}')
  12.  
  13. record_volume()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement