{"id":313652,"date":"2020-11-24T09:00:31","date_gmt":"2020-11-24T09:00:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=313652"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=313652","title":{"rendered":"\u041f\u0438\u0448\u0435\u043c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u043d\u0430 Python"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0433\u043e\u0434 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u0442\u0440\u044f\u0441\u0430\u044e\u0449\u0435\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e. \u0412\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044f \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0443\u043c\u043d\u044b\u0445 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0445 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u043e\u0432.<\/p>\n<p>  \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0430\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0434\u0435\u0439 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0435\u0449\u0451 \u0443\u043c\u043d\u0435\u0435 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u0435\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/oy\/is\/ic\/oyisicrneajt9fxd_spvhgvw0cq.jpeg\" alt=\"image\"\/><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u0427\u0442\u043e \u0443\u043c\u0435\u0435\u0442 \u043c\u043e\u0439 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442?<\/h3>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td align=\"center\"><b>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0443\u043c\u0435\u043d\u0438\u044f<\/b><\/td>\n<td align=\"center\"><b>\u0420\u0430\u0431\u043e\u0442\u0430 \u0432 offline-\u0440\u0435\u0436\u0438\u043c\u0435<\/b><\/td>\n<td align=\"center\"><b>\u0422\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/b><\/td>\n<\/tr>\n<tr>\n<td>\u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0438 \u0441\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0447\u044c<\/td>\n<td align=\"center\">\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/td>\n<td>pip install PyAudio (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d\u0430)<\/p>\n<p>  pip install pyttsx3 (\u0441\u0438\u043d\u0442\u0435\u0437 \u0440\u0435\u0447\u0438)<\/p>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0438\u043b\u0438 \u0432\u0437\u044f\u0442\u044c \u043e\u0431\u0435:<\/p>\n<ul>\n<li> pip install SpeechRecognition (\u0432\u044b\u0441\u043e\u043a\u043e\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e online-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f, \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044f\u0437\u044b\u043a\u043e\u0432)<\/li>\n<li> pip install vosk (\u0432\u044b\u0441\u043e\u043a\u043e\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e offline-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f, \u043c\u0435\u043d\u044c\u0448\u0435 \u044f\u0437\u044b\u043a\u043e\u0432)<\/li>\n<\/ul>\n<p>  <\/td>\n<\/tr>\n<tr>\n<td>\u0421\u043e\u043e\u0431\u0449\u0430\u0442\u044c \u043e \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0435 \u043f\u043e\u0433\u043e\u0434\u044b \u0432 \u043b\u044e\u0431\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 \u043c\u0438\u0440\u0430<\/td>\n<td align=\"center\">\u041d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/td>\n<td>pip install pyowm (OpenWeatherMap)<\/td>\n<\/tr>\n<tr>\n<td>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Google (\u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430)<\/td>\n<td align=\"center\">\u041d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/td>\n<td>pip install google<\/td>\n<\/tr>\n<tr>\n<td>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u0438\u0434\u0435\u043e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 YouTube<\/td>\n<td align=\"center\">\u041d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/td>\n<td align=\"center\">&#8212;<\/td>\n<\/tr>\n<tr>\n<td>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432 Wikipedia c \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0445 \u0434\u0432\u0443\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/td>\n<td align=\"center\">\u041d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/td>\n<td>pip install wikipedia-api<\/td>\n<\/tr>\n<tr>\n<td>\u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0444\u0440\u0430\u0437\u044b \u0441 \u0438\u0437\u0443\u0447\u0430\u0435\u043c\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043d\u0430 \u0440\u043e\u0434\u043d\u043e\u0439 \u044f\u0437\u044b\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442<\/td>\n<td align=\"center\">\u041d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/td>\n<td>pip install googletrans (Google Translate)<\/td>\n<\/tr>\n<tr>\n<td>\u0418\u0441\u043a\u0430\u0442\u044c \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0438 \u0444\u0430\u043c\u0438\u043b\u0438\u0438 \u0432 \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0442\u044f\u0445<\/td>\n<td align=\"center\">\u041d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/td>\n<td align=\"center\">&#8212;<\/td>\n<\/tr>\n<tr>\n<td>\u00ab\u041f\u043e\u0434\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u043c\u043e\u043d\u0435\u0442\u043a\u0443\u00bb<\/td>\n<td align=\"center\">\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/td>\n<td align=\"center\">&#8212;<\/td>\n<\/tr>\n<tr>\n<td>\u0417\u0434\u043e\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u0440\u043e\u0449\u0430\u0442\u044c\u0441\u044f (\u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0449\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f)<\/td>\n<td align=\"center\">\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/td>\n<td align=\"center\">&#8212;<\/td>\n<\/tr>\n<tr>\n<td>\u041c\u0435\u043d\u044f\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044f\u0437\u044b\u043a\u0430 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0438 \u0441\u0438\u043d\u0442\u0435\u0437\u0430 \u0440\u0435\u0447\u0438 \u043d\u0430 \u0445\u043e\u0434\u0443<\/td>\n<td align=\"center\">\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/td>\n<td align=\"center\">&#8212;<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\"><i>TODO \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435&#8230;<\/i><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>  <\/p>\n<h3>\u0428\u0430\u0433 1. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430<\/h3>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0432\u0432\u043e\u0434. \u041d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d \u0438 \u043f\u0430\u0440\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a: PyAudio \u0438 SpeechRecognition.<\/p>\n<p>  \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c main-\u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"python\">import speech_recognition  if __name__ == &quot;__main__&quot;:      # \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u0432\u043e\u0434\u0430 \u0440\u0435\u0447\u0438     recognizer = speech_recognition.Recognizer()     microphone = speech_recognition.Microphone()      while True:         # \u0441\u0442\u0430\u0440\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0440\u0435\u0447\u0438 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0447\u0438          voice_input = record_and_recognize_audio()         print(voice_input) <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438. \u0414\u043b\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f Google, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u043e\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u044f\u0437\u044b\u043a\u043e\u0432.<\/p>\n<pre><code class=\"python\">def record_and_recognize_audio(*args: tuple):     &quot;&quot;&quot;     \u0417\u0430\u043f\u0438\u0441\u044c \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0430\u0443\u0434\u0438\u043e     &quot;&quot;&quot;     with microphone:         recognized_data = &quot;&quot;          # \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u044f \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u0448\u0443\u043c\u0430         recognizer.adjust_for_ambient_noise(microphone, duration=2)          try:             print(&quot;Listening...&quot;)             audio = recognizer.listen(microphone, 5, 5)          except speech_recognition.WaitTimeoutError:             print(&quot;Can you check if your microphone is on, please?&quot;)             return          # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 online-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 Google          try:             print(&quot;Started recognition...&quot;)             recognized_data = recognizer.recognize_google(audio, language=&quot;ru&quot;).lower()          except speech_recognition.UnknownValueError:             pass          # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0431\u0440\u043e\u0441 \u043e\u0448\u0438\u0431\u043a\u0438         except speech_recognition.RequestError:             print(&quot;Check your Internet Connection, please&quot;)          return recognized_data <\/code><\/pre>\n<p>  \u0410 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442? \u041c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0434\u043b\u044f offline-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f. \u041c\u043d\u0435 \u043b\u0438\u0447\u043d\u043e \u0431\u0435\u0437\u0443\u043c\u043d\u043e \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/github.com\/alphacep\/vosk-api\">Vosk<\/a>.  <\/p>\n<blockquote><p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c offline-\u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0435\u0441\u043b\u0438 \u043e\u043d \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d. \u041c\u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u0442\u0430\u0442\u044c\u0438, \u0430 \u0432\u044b \u0443\u0436\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0439\u0442\u0435, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0441\u0432\u043e\u0438\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0431\u0435\u0441\u0441\u043f\u043e\u0440\u043d\u043e \u043b\u0438\u0434\u0438\u0440\u0443\u0435\u0442 Google).<\/p><\/blockquote>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c, \u0432\u043d\u0435\u0434\u0440\u0438\u0432 offline-\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0435\u0442\u0438 \u0443 \u043d\u0430\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 offline-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435. <\/p>\n<p>  \u0417\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0444\u0440\u0430\u0437\u0443, \u044f \u0440\u0435\u0448\u0438\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0430\u0443\u0434\u0438\u043e \u0441 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 wav-\u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f. <\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">from vosk import Model, KaldiRecognizer  # \u043e\u0444\u0444\u043b\u0430\u0439\u043d-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043e\u0442 Vosk import speech_recognition  # \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0440\u0435\u0447\u0438 (Speech-To-Text) import wave  # \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0447\u0442\u0435\u043d\u0438\u0435 \u0430\u0443\u0434\u0438\u043e\u0444\u0430\u0439\u043b\u043e\u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 wav import json  # \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 json-\u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 json-\u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 import os  # \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439   def record_and_recognize_audio(*args: tuple):     &quot;&quot;&quot;     \u0417\u0430\u043f\u0438\u0441\u044c \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0430\u0443\u0434\u0438\u043e     &quot;&quot;&quot;     with microphone:         recognized_data = &quot;&quot;          # \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u044f \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u0448\u0443\u043c\u0430         recognizer.adjust_for_ambient_noise(microphone, duration=2)          try:             print(&quot;Listening...&quot;)             audio = recognizer.listen(microphone, 5, 5)              with open(&quot;microphone-results.wav&quot;, &quot;wb&quot;) as file:                 file.write(audio.get_wav_data())          except speech_recognition.WaitTimeoutError:             print(&quot;Can you check if your microphone is on, please?&quot;)             return          # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 online-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 Google          try:             print(&quot;Started recognition...&quot;)             recognized_data = recognizer.recognize_google(audio, language=&quot;ru&quot;).lower()          except speech_recognition.UnknownValueError:             pass          # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0430          # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c offline-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 Vosk         except speech_recognition.RequestError:             print(&quot;Trying to use offline recognition...&quot;)             recognized_data = use_offline_recognition()          return recognized_data   def use_offline_recognition():     &quot;&quot;&quot;     \u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0444\u0444\u043b\u0430\u0439\u043d-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0447\u0438     :return: \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u0430\u044f \u0444\u0440\u0430\u0437\u0430     &quot;&quot;&quot;     recognized_data = &quot;&quot;     try:         # \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043d\u0443\u0436\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f         if not os.path.exists(&quot;models\/vosk-model-small-ru-0.4&quot;):             print(&quot;Please download the model from:\\n&quot;                   &quot;https:\/\/alphacephei.com\/vosk\/models and unpack as 'model' in the current folder.&quot;)             exit(1)          # \u0430\u043d\u0430\u043b\u0438\u0437 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d \u0430\u0443\u0434\u0438\u043e (\u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043e\u0432 \u0444\u0440\u0430\u0437\u044b)         wave_audio_file = wave.open(&quot;microphone-results.wav&quot;, &quot;rb&quot;)         model = Model(&quot;models\/vosk-model-small-ru-0.4&quot;)         offline_recognizer = KaldiRecognizer(model, wave_audio_file.getframerate())          data = wave_audio_file.readframes(wave_audio_file.getnframes())         if len(data) &gt; 0:             if offline_recognizer.AcceptWaveform(data):                 recognized_data = offline_recognizer.Result()                  # \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u0437 JSON-\u0441\u0442\u0440\u043e\u043a\u0438                 # (\u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u0434\u0430\u0442\u044c \u043f\u043e \u043d\u0435\u0439 \u043e\u0442\u0432\u0435\u0442)                 recognized_data = json.loads(recognized_data)                 recognized_data = recognized_data[&quot;text&quot;]     except:         print(&quot;Sorry, speech service is unavailable. Try again later&quot;)      return recognized_data   if __name__ == &quot;__main__&quot;:      # \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u0432\u043e\u0434\u0430 \u0440\u0435\u0447\u0438     recognizer = speech_recognition.Recognizer()     microphone = speech_recognition.Microphone()      while True:         # \u0441\u0442\u0430\u0440\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0440\u0435\u0447\u0438 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0447\u0438         # \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d \u0430\u0443\u0434\u0438\u043e         voice_input = record_and_recognize_audio()         os.remove(&quot;microphone-results.wav&quot;)         print(voice_input) <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u0435 \u00ab\u0410 \u0437\u0430\u0447\u0435\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c offline-\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438?\u00bb<\/p>\n<p>  \u042f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0442\u043e\u0438\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u0440\u0435\u0437\u0430\u043d \u043e\u0442 \u0441\u0435\u0442\u0438. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442 \u0432\u0441\u0451 \u0435\u0449\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u043d\u043e\u0433\u043e \u0431\u043e\u0442\u0430 \u0438\u043b\u0438 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0440\u044f\u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e, \u043f\u043e\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u043b\u044c\u043c, \u043f\u043e\u043c\u043e\u0447\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0431\u043e\u0440 \u043a\u0443\u0445\u043d\u0438, \u0441\u044b\u0433\u0440\u0430\u0442\u044c \u0432 \u0438\u0433\u0440\u0443 \u0438 \u0442.\u0434.<\/p>\n<h3>\u0428\u0430\u0433 2. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430<\/h3>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430\u0448 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043f\u043e\u043b, \u044f\u0437\u044b\u043a \u0440\u0435\u0447\u0438, \u043d\u0443 \u0438 \u043f\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u043a\u0435, \u0438\u043c\u044f, \u0442\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u044b\u0434\u0435\u043b\u0438\u043c \u043f\u043e\u0434 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u0442\u044c \u043d\u0430\u0448\u0435\u043c\u0443 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0443 \u0433\u043e\u043b\u043e\u0441, \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0434\u043b\u044f offline-\u0441\u0438\u043d\u0442\u0435\u0437\u0430 \u0440\u0435\u0447\u0438 pyttsx3. \u041e\u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0439\u0434\u0435\u0442 \u0433\u043e\u043b\u043e\u0441\u0430, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u0438\u043d\u0442\u0435\u0437\u0430 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (\u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u0435 \u0433\u043e\u043b\u043e\u0441\u0430 \u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b).<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0432 main-\u043c\u0435\u0442\u043e\u0434 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0438\u043d\u0442\u0435\u0437\u0430 \u0440\u0435\u0447\u0438 \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0435\u0451 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u044f. \u0427\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441 \u043d\u0430\u043c\u0438 \u043f\u043e\u0437\u0434\u043e\u0440\u043e\u0432\u0430\u043b\u0441\u044f, \u0438 \u0432\u044b\u0434\u0430\u0434\u0438\u043c \u0435\u043c\u0443 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043e\u0442 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0441\u043d\u043e\u0432\u044b \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 (\u0441\u0438\u043d\u0442\u0435\u0437 \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0447\u0438)<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">from vosk import Model, KaldiRecognizer  # \u043e\u0444\u0444\u043b\u0430\u0439\u043d-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043e\u0442 Vosk import speech_recognition  # \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0440\u0435\u0447\u0438 (Speech-To-Text) import pyttsx3  # \u0441\u0438\u043d\u0442\u0435\u0437 \u0440\u0435\u0447\u0438 (Text-To-Speech) import wave  # \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0447\u0442\u0435\u043d\u0438\u0435 \u0430\u0443\u0434\u0438\u043e\u0444\u0430\u0439\u043b\u043e\u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 wav import json  # \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 json-\u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 json-\u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 import os  # \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439   class VoiceAssistant:     &quot;&quot;&quot;     \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0435 \u0438\u043c\u044f, \u043f\u043e\u043b, \u044f\u0437\u044b\u043a \u0440\u0435\u0447\u0438     &quot;&quot;&quot;     name = &quot;&quot;     sex = &quot;&quot;     speech_language = &quot;&quot;     recognition_language = &quot;&quot;   def setup_assistant_voice():     &quot;&quot;&quot;     \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0433\u043e\u043b\u043e\u0441\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (\u0438\u043d\u0434\u0435\u043a\u0441 \u043c\u043e\u0436\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432      \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b)     &quot;&quot;&quot;     voices = ttsEngine.getProperty(&quot;voices&quot;)      if assistant.speech_language == &quot;en&quot;:         assistant.recognition_language = &quot;en-US&quot;         if assistant.sex == &quot;female&quot;:             # Microsoft Zira Desktop - English (United States)             ttsEngine.setProperty(&quot;voice&quot;, voices[1].id)         else:             # Microsoft David Desktop - English (United States)             ttsEngine.setProperty(&quot;voice&quot;, voices[2].id)     else:         assistant.recognition_language = &quot;ru-RU&quot;         # Microsoft Irina Desktop - Russian         ttsEngine.setProperty(&quot;voice&quot;, voices[0].id)   def play_voice_assistant_speech(text_to_speech):     &quot;&quot;&quot;     \u041f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0447\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 (\u0431\u0435\u0437 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0430\u0443\u0434\u0438\u043e)     :param text_to_speech: \u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0435\u0447\u044c     &quot;&quot;&quot;     ttsEngine.say(str(text_to_speech))     ttsEngine.runAndWait()   def record_and_recognize_audio(*args: tuple):     &quot;&quot;&quot;     \u0417\u0430\u043f\u0438\u0441\u044c \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0430\u0443\u0434\u0438\u043e     &quot;&quot;&quot;     with microphone:         recognized_data = &quot;&quot;          # \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u044f \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u0448\u0443\u043c\u0430         recognizer.adjust_for_ambient_noise(microphone, duration=2)          try:             print(&quot;Listening...&quot;)             audio = recognizer.listen(microphone, 5, 5)              with open(&quot;microphone-results.wav&quot;, &quot;wb&quot;) as file:                 file.write(audio.get_wav_data())          except speech_recognition.WaitTimeoutError:             print(&quot;Can you check if your microphone is on, please?&quot;)             return          # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 online-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 Google          # (\u0432\u044b\u0441\u043e\u043a\u043e\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f)         try:             print(&quot;Started recognition...&quot;)             recognized_data = recognizer.recognize_google(audio, language=&quot;ru&quot;).lower()          except speech_recognition.UnknownValueError:             pass          # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442          # \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c offline-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 Vosk         except speech_recognition.RequestError:             print(&quot;Trying to use offline recognition...&quot;)             recognized_data = use_offline_recognition()          return recognized_data   def use_offline_recognition():     &quot;&quot;&quot;     \u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0444\u0444\u043b\u0430\u0439\u043d-\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0447\u0438     :return: \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u0430\u044f \u0444\u0440\u0430\u0437\u0430     &quot;&quot;&quot;     recognized_data = &quot;&quot;     try:         # \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043d\u0443\u0436\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f         if not os.path.exists(&quot;models\/vosk-model-small-ru-0.4&quot;):             print(&quot;Please download the model from:\\n&quot;                   &quot;https:\/\/alphacephei.com\/vosk\/models and unpack as 'model' in the current folder.&quot;)             exit(1)          # \u0430\u043d\u0430\u043b\u0438\u0437 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d \u0430\u0443\u0434\u0438\u043e (\u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043e\u0432 \u0444\u0440\u0430\u0437\u044b)         wave_audio_file = wave.open(&quot;microphone-results.wav&quot;, &quot;rb&quot;)         model = Model(&quot;models\/vosk-model-small-ru-0.4&quot;)         offline_recognizer = KaldiRecognizer(model, wave_audio_file.getframerate())          data = wave_audio_file.readframes(wave_audio_file.getnframes())         if len(data) &gt; 0:             if offline_recognizer.AcceptWaveform(data):                 recognized_data = offline_recognizer.Result()                  # \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u0437 JSON-\u0441\u0442\u0440\u043e\u043a\u0438                  # (\u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u0434\u0430\u0442\u044c \u043f\u043e \u043d\u0435\u0439 \u043e\u0442\u0432\u0435\u0442)                 recognized_data = json.loads(recognized_data)                 recognized_data = recognized_data[&quot;text&quot;]     except:         print(&quot;Sorry, speech service is unavailable. Try again later&quot;)      return recognized_data   if __name__ == &quot;__main__&quot;:      # \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u0432\u043e\u0434\u0430 \u0440\u0435\u0447\u0438     recognizer = speech_recognition.Recognizer()     microphone = speech_recognition.Microphone()      # \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0441\u0438\u043d\u0442\u0435\u0437\u0430 \u0440\u0435\u0447\u0438     ttsEngine = pyttsx3.init()      # \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430     assistant = VoiceAssistant()     assistant.name = &quot;Alice&quot;     assistant.sex = &quot;female&quot;     assistant.speech_language = &quot;ru&quot;      # \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0433\u043e\u043b\u043e\u0441\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e     setup_assistant_voice()      while True:         # \u0441\u0442\u0430\u0440\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0440\u0435\u0447\u0438 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0447\u0438         # \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d \u0430\u0443\u0434\u0438\u043e         voice_input = record_and_recognize_audio()         os.remove(&quot;microphone-results.wav&quot;)         print(voice_input)          # \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043c\u0430\u043d\u0434 \u043e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432)         voice_input = voice_input.split(&quot; &quot;)         command = voice_input[0]          if command == &quot;\u043f\u0440\u0438\u0432\u0435\u0442&quot;:             play_voice_assistant_speech(&quot;\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439&quot;) <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0437\u0434\u0435\u0441\u044c \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0438\u043d\u0442\u0435\u0437\u0430\u0442\u043e\u0440 \u0440\u0435\u0447\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u043c\u043e\u0438\u0445 \u0437\u043d\u0430\u043d\u0438\u0439 \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u0415\u0441\u043b\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u0443, \u043a\u0443\u0440\u0441 \u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u2014 \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<h3>\u0428\u0430\u0433 3. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u00ab\u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c\u00bb \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0438 \u0441\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0447\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043e\u043a \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043b\u043b\u0435\u0433, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0440\u0435\u0447\u0435\u0432\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \ud83d\ude00<\/p>\n<p>  \u0412 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u043c\u0435\u043d\u044f \u0432 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0438 \u043c\u0435\u043d\u044f \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041e\u0434\u043d\u0430\u043a\u043e, \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u044f\u0437\u044b\u043a\u0430\u043c.<\/p>\n<p>  \u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u044f \u043c\u043e\u0433\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430.<\/p>\n<h4>1 \u0441\u043f\u043e\u0441\u043e\u0431<\/h4>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 JSON-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u044f, \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f, \u043e\u0442\u0432\u0435\u0442\u044b \u043f\u0440\u0438 \u043d\u0435\u0443\u0434\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u0445 (\u0442\u0430\u043a\u0438\u0435 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0447\u0430\u0442-\u0431\u043e\u0442\u043e\u0432). \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">config = {     &quot;intents&quot;: {         &quot;greeting&quot;: {             &quot;examples&quot;: [&quot;\u043f\u0440\u0438\u0432\u0435\u0442&quot;, &quot;\u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439&quot;, &quot;\u0434\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c&quot;,                          &quot;hello&quot;, &quot;good morning&quot;],             &quot;responses&quot;: play_greetings         },         &quot;farewell&quot;: {             &quot;examples&quot;: [&quot;\u043f\u043e\u043a\u0430&quot;, &quot;\u0434\u043e \u0441\u0432\u0438\u0434\u0430\u043d\u0438\u044f&quot;, &quot;\u0443\u0432\u0438\u0434\u0438\u043c\u0441\u044f&quot;, &quot;\u0434\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0438&quot;,                          &quot;goodbye&quot;, &quot;bye&quot;, &quot;see you soon&quot;],             &quot;responses&quot;: play_farewell_and_quit         },         &quot;google_search&quot;: {             &quot;examples&quot;: [&quot;\u043d\u0430\u0439\u0434\u0438 \u0432 \u0433\u0443\u0433\u043b&quot;,                          &quot;search on google&quot;, &quot;google&quot;, &quot;find on google&quot;],             &quot;responses&quot;: search_for_term_on_google         },     },     &quot;failure_phrases&quot;: play_failure_phrase } <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0442\u0435\u043c, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043d\u0430\u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043e\u0442\u0432\u0435\u0447\u0430\u043b \u043d\u0430 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0444\u0440\u0430\u0437\u044b. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0437\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c NLU-\u043f\u043e\u0434\u0445\u043e\u0434 \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u0433\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0441\u0432\u0435\u0440\u044f\u044f \u0438\u0445 \u0441 \u0442\u0435\u043c\u0438, \u0447\u0442\u043e \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. <\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043c\u044b \u0435\u0433\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 5 \u0448\u0430\u0433\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0410 \u043f\u043e\u043a\u0430 \u043e\u0431\u0440\u0430\u0449\u0443 \u0432\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/p>\n<h4>2 \u0441\u043f\u043e\u0441\u043e\u0431<\/h4>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 hashable-\u0442\u0438\u043f tuple, \u0430 \u0432 \u0432\u0438\u0434\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f. \u0414\u043b\u044f \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<pre><code class=\"python\">commands = {     (&quot;hello&quot;, &quot;hi&quot;, &quot;morning&quot;, &quot;\u043f\u0440\u0438\u0432\u0435\u0442&quot;): play_greetings,     (&quot;bye&quot;, &quot;goodbye&quot;, &quot;quit&quot;, &quot;exit&quot;, &quot;stop&quot;, &quot;\u043f\u043e\u043a\u0430&quot;): play_farewell_and_quit,     (&quot;search&quot;, &quot;google&quot;, &quot;find&quot;, &quot;\u043d\u0430\u0439\u0434\u0438&quot;): search_for_term_on_google,     (&quot;video&quot;, &quot;youtube&quot;, &quot;watch&quot;, &quot;\u0432\u0438\u0434\u0435\u043e&quot;): search_for_video_on_youtube,     (&quot;wikipedia&quot;, &quot;definition&quot;, &quot;about&quot;, &quot;\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435&quot;, &quot;\u0432\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u044f&quot;): search_for_definition_on_wikipedia,     (&quot;translate&quot;, &quot;interpretation&quot;, &quot;translation&quot;, &quot;\u043f\u0435\u0440\u0435\u0432\u043e\u0434&quot;, &quot;\u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438&quot;, &quot;\u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0438&quot;): get_translation,     (&quot;language&quot;, &quot;\u044f\u0437\u044b\u043a&quot;): change_language,     (&quot;weather&quot;, &quot;forecast&quot;, &quot;\u043f\u043e\u0433\u043e\u0434\u0430&quot;, &quot;\u043f\u0440\u043e\u0433\u043d\u043e\u0437&quot;): get_weather_forecast, } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">def execute_command_with_name(command_name: str, *args: list):     &quot;&quot;&quot;     \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438     :param command_name: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b     :param args: \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u0432 \u043c\u0435\u0442\u043e\u0434     :return:     &quot;&quot;&quot;     for key in commands.keys():         if command_name in key:             commands[key](*args)         else:             pass  # print(&quot;Command not found&quot;)   if __name__ == &quot;__main__&quot;:      # \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u0432\u043e\u0434\u0430 \u0440\u0435\u0447\u0438     recognizer = speech_recognition.Recognizer()     microphone = speech_recognition.Microphone()      while True:         # \u0441\u0442\u0430\u0440\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0440\u0435\u0447\u0438 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0447\u0438         # \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d \u0430\u0443\u0434\u0438\u043e         voice_input = record_and_recognize_audio()         os.remove(&quot;microphone-results.wav&quot;)         print(voice_input)          # \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043c\u0430\u043d\u0434 \u043e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432)         voice_input = voice_input.split(&quot; &quot;)         command = voice_input[0]         command_options = [str(input_part) for input_part in voice_input[1:len(voice_input)]]         execute_command_with_name(command, command_options) <\/code><\/pre>\n<p>  \u0412 \u043c\u0435\u0442\u043e\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u0441\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430. \u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0444\u0440\u0430\u0437\u0443 &quot;<i>\u0432\u0438\u0434\u0435\u043e \u043c\u0438\u043b\u044b\u0435 \u043a\u043e\u0442\u0438\u043a\u0438<\/i>&quot;, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 &quot;<i>\u0432\u0438\u0434\u0435\u043e<\/i>&quot; \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 search_for_video_on_youtube() \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c &quot;<i>\u043c\u0438\u043b\u044b\u0435 \u043a\u043e\u0442\u0438\u043a\u0438<\/i>&quot; \u0438 \u0432\u044b\u0434\u0430\u0441\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pt\/cm\/84\/ptcm84xx8l-le7bm3fb3sbcp9ei.png\" alt=\"image\"\/><\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">def search_for_video_on_youtube(*args: tuple):     &quot;&quot;&quot;     \u041f\u043e\u0438\u0441\u043a \u0432\u0438\u0434\u0435\u043e \u043d\u0430 YouTube \u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432     :param args: \u0444\u0440\u0430\u0437\u0430 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430     &quot;&quot;&quot;     if not args[0]: return     search_term = &quot; &quot;.join(args[0])     url = &quot;https:\/\/www.youtube.com\/results?search_query=&quot; + search_term     webbrowser.get().open(url)      # \u0434\u043b\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u044b\u0445 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0445 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043e\u0432 \u043b\u0443\u0447\u0448\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c      # \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0431\u0440\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0438\u0437 JSON-\u0444\u0430\u0439\u043b\u0430     play_voice_assistant_speech(&quot;Here is what I found for &quot; + search_term + &quot;on youtube&quot;) <\/code><\/pre>\n<p>  \u041d\u0443 \u0432\u043e\u0442 \u0438 \u0432\u0441\u0451! \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u043e\u0442\u0430 \u0433\u043e\u0442\u043e\u0432. \u0414\u0430\u043b\u0435\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438 \u0443\u043b\u0443\u0447\u0448\u0430\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438. \u041c\u043e\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043d\u0430 <a href=\"https:\/\/github.com\/EnjiRouz\/Voice-Assistant-App\">\u043c\u043e\u0451\u043c GitHub<\/a>.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u044f\u0434 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u0435\u0449\u0451 \u0443\u043c\u043d\u0435\u0435.<\/p>\n<h3>\u0428\u0430\u0433 4. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438, \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 JSON-\u0444\u0430\u0439\u043b \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439:<\/p>\n<pre><code class=\"python\">{   &quot;Can you check if your microphone is on, please?&quot;: {     &quot;ru&quot;: &quot;\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u044c, \u0447\u0442\u043e \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d \u0432\u043a\u043b\u044e\u0447\u0435\u043d&quot;,     &quot;en&quot;: &quot;Can you check if your microphone is on, please?&quot;   },   &quot;What did you say again?&quot;: {     &quot;ru&quot;: &quot;\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u0438&quot;,     &quot;en&quot;: &quot;What did you say again?&quot;   }, } <\/code><\/pre>\n<p>  \u0412 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0440\u0443\u0441\u0441\u043a\u0438\u043c \u0438 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u043c \u044f\u0437\u044b\u043a\u043e\u043c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u043d\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438 \u0438 \u0433\u043e\u043b\u043e\u0441\u0430 \u0434\u043b\u044f \u0441\u0438\u043d\u0442\u0435\u0437\u0430 \u0440\u0435\u0447\u0438. \u042f\u0437\u044b\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u044f\u0437\u044b\u043a\u0430 \u0440\u0435\u0447\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0430\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c:<\/p>\n<pre><code class=\"python\">class Translation:     &quot;&quot;&quot;     \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0432\u0448\u0438\u0442\u043e\u0433\u043e \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441\u0442\u0440\u043e\u043a \u0434\u043b\u044f      \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430     &quot;&quot;&quot;     with open(&quot;translations.json&quot;, &quot;r&quot;, encoding=&quot;UTF-8&quot;) as file:         translations = json.load(file)       def get(self, text: str):         &quot;&quot;&quot;         \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0439 \u044f\u0437\u044b\u043a (\u043f\u043e \u0435\u0433\u043e \u043a\u043e\u0434\u0443)         :param text: \u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438         :return: \u0432\u0448\u0438\u0442\u044b\u0439 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0442\u0435\u043a\u0441\u0442\u0430         &quot;&quot;&quot;         if text in self.translations:             return self.translations[text][assistant.speech_language]         else:             # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0432\u043e\u0434 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f              # \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u043b\u043e\u0433\u0430\u0445 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430             print(colored(&quot;Not translated phrase: {}&quot;.format(text), &quot;red&quot;))             return text <\/code><\/pre>\n<p>  \u0412 main-\u043c\u0435\u0442\u043e\u0434\u0435 \u0434\u043e \u0446\u0438\u043a\u043b\u0430 \u043e\u0431\u044a\u044f\u0432\u0438\u043c \u043d\u0430\u0448 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: translator = Translation()<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u0438 \u0440\u0435\u0447\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">play_voice_assistant_speech(translator.get(     &quot;Here is what I found for {} on Wikipedia&quot;).format(search_term)) <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0448\u0435, \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u0442\u0435\u0445 \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u00ab\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435\u00bb \u043d\u0430\u0431\u043e\u0440\u044b \u0444\u0440\u0430\u0437 \u0434\u043b\u044f \u0432\u0430\u0448\u0438\u0445 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043e\u0432.<\/p>\n<h3>\u0428\u0430\u0433 5. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f<\/h3>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u043e\u043c\u0443 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0447\u0430\u0442-\u0431\u043e\u0442\u043e\u0432 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0443 \u0441 JSON-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u043b\u043e\u0432, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u0430 \u0432 \u043f\u0443\u043d\u043a\u0442\u0435 3. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0443 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<pre><code class=\"python\">def prepare_corpus():     &quot;&quot;&quot;     \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u0443\u0433\u0430\u0434\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f     &quot;&quot;&quot;     corpus = []     target_vector = []     for intent_name, intent_data in config[&quot;intents&quot;].items():         for example in intent_data[&quot;examples&quot;]:             corpus.append(example)             target_vector.append(intent_name)      training_vector = vectorizer.fit_transform(corpus)     classifier_probability.fit(training_vector, target_vector)     classifier.fit(training_vector, target_vector)   def get_intent(request):     &quot;&quot;&quot;     \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0433\u043e \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f     :param request: \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f     :return: \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0435 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0435     &quot;&quot;&quot;     best_intent = classifier.predict(vectorizer.transform([request]))[0]      index_of_best_intent = list(classifier_probability.classes_).index(best_intent)     probabilities = classifier_probability.predict_proba(vectorizer.transform([request]))[0]      best_intent_probability = probabilities[index_of_best_intent]      # \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0441\u0442\u043e\u0438\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c     if best_intent_probability &gt; 0.57:         return best_intent <\/code><\/pre>\n<p>  \u0410 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c main-\u043c\u0435\u0442\u043e\u0434, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u0446\u0438\u043a\u043b \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044e, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043d\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\"># \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a\u043e\u0440\u043f\u0443\u0441\u0430 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e # (\u043f\u043e\u0438\u0441\u043a \u043f\u043e\u0445\u043e\u0436\u0438\u0445) vectorizer = TfidfVectorizer(analyzer=&quot;char&quot;, ngram_range=(2, 3)) classifier_probability = LogisticRegression() classifier = LinearSVC() prepare_corpus()  while True:     # \u0441\u0442\u0430\u0440\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0440\u0435\u0447\u0438 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0447\u0438      # \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d \u0430\u0443\u0434\u0438\u043e     voice_input = record_and_recognize_audio()      if os.path.exists(&quot;microphone-results.wav&quot;):         os.remove(&quot;microphone-results.wav&quot;)      print(colored(voice_input, &quot;blue&quot;))      # \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432)     if voice_input:         voice_input_parts = voice_input.split(&quot; &quot;)          # \u0435\u0441\u043b\u0438 \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043e\u0434\u043d\u043e \u0441\u043b\u043e\u0432\u043e - \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0441\u0440\u0430\u0437\u0443          # \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432         if len(voice_input_parts) == 1:             intent = get_intent(voice_input)             if intent:                 config[&quot;intents&quot;][intent][&quot;responses&quot;]()             else:                 config[&quot;failure_phrases&quot;]()          # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \u0444\u0440\u0430\u0437\u044b - \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0438\u0441\u043a \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0439 \u0444\u0440\u0430\u0437\u044b          # \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043b\u043e\u0432\u043e,         # \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435         if len(voice_input_parts) &gt; 1:             for guess in range(len(voice_input_parts)):                 intent = get_intent((&quot; &quot;.join(voice_input_parts[0:guess])).strip())                 if intent:                     command_options = [voice_input_parts[guess:len(voice_input_parts)]]                     config[&quot;intents&quot;][intent][&quot;responses&quot;](*command_options)                     break                 if not intent and guess == len(voice_input_parts)-1:                     config[&quot;failure_phrases&quot;]() <\/code><\/pre>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c: \u043e\u043d \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f \u0444\u0440\u0430\u0437\u0430 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0432\u0435\u0440\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u0441\u0442\u044c\u044e (\u043b\u0438\u0431\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0441\u0430\u043c\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e).<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043f\u043e\u0434\u043e\u0448\u0451\u043b \u043a \u043a\u043e\u043d\u0446\u0443. <\/p>\n<p>  \u041c\u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u044f\u0442\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0441\u043e \u043c\u043d\u043e\u0439 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0432\u0430\u043c open-source \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0430\u0448\u0438\u043c\u0438 \u0438\u0434\u0435\u044f\u043c\u0438 \u043a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u0438\u0435 \u0435\u0449\u0451 online \u0438 offline-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>  \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043c\u043e\u0435\u0433\u043e \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u0432 \u0434\u0432\u0443\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/EnjiRouz\/Voice-Assistant-App\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/529590\/\"> https:\/\/habr.com\/ru\/post\/529590\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0433\u043e\u0434 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u0442\u0440\u044f\u0441\u0430\u044e\u0449\u0435\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e. \u0412\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044f \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0443\u043c\u043d\u044b\u0445 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0445 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u043e\u0432.<\/p>\n<p>  \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0430\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0434\u0435\u0439 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0435\u0449\u0451 \u0443\u043c\u043d\u0435\u0435 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u0435\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/oy\/is\/ic\/oyisicrneajt9fxd_spvhgvw0cq.jpeg\" alt=\"image\"\/>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-313652","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/313652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=313652"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/313652\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=313652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=313652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=313652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}