{"id":325559,"date":"2021-06-27T15:00:19","date_gmt":"2021-06-27T15:00:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=325559"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=325559","title":{"rendered":"\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0434\u043d\u0435\u0432\u043d\u0438\u043a \u043d\u0430 python \u0441 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435\u043c \u0433\u043e\u043b\u043e\u0441\u0430 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0432 Mongo DB"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a1d\/d89\/4b9\/a1dd894b9de0001515041685b744b0db.png\" width=\"1280\" height=\"671\"><figcaption><\/figcaption><\/figure>\n<h2>\u0417\u0430\u0447\u0435\u043c \u0432\u0441\u0451 \u044d\u0442\u043e? <\/h2>\n<p>\u0412\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0441\u0442\u0435\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u041c\u043d\u043e\u0433\u0438\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438-\u0433\u0438\u0433\u0430\u043d\u0442\u044b \u0441\u0442\u0440\u0435\u043c\u044f\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430. \u041d\u043e \u0440\u0435\u0447\u0435\u0432\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c. \u041a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 <s>\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0435\u0449\u0435 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0435\u0435<\/s> .<\/p>\n<p>\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0434\u043d\u0435\u0432\u043d\u0438\u043a &#8212; \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0432 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. <\/p>\n<h2>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<p>\u0423 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0430 \u0435\u0441\u0442\u044c 4 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0430\u0443\u0434\u0438\u043e\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 <\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0431\u0430\u0437\u0443 <\/p>\n<\/li>\n<li>\n<p>\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0431\u0430\u0437\u044b<\/p>\n<\/li>\n<li>\n<p>\u0438\u043c\u0435\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<figure class=\"float bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/355\/a09\/1fd\/355a091fda09777b879d212625ee903f.png\" alt=\"\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0442\u0435\u043a \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0430\" title=\"\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0442\u0435\u043a \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0430\" width=\"807\" height=\"1280\"><figcaption>\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0442\u0435\u043a \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0430<\/figcaption><\/figure>\n<p>\u0411\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c mongo db \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e <s>\u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e\u0433\u043e<\/s> \u0442\u0435\u043a\u0441\u0442\u0430, docker \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, telegram \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c vosk \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0433\u043e\u043b\u043e\u0441\u0430. <\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435  \u0441 \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u043c\u0438 \u0447\u0430\u0441\u0442\u044f\u043c\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0430. <\/p>\n<h2>\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0434\u0432\u0438\u0436\u043e\u043a<\/h2>\n<p>\u0414\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0433\u043e\u043b\u043e\u0441\u0430 \u043d\u0443\u0436\u043d\u0430 \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c (online \u0438\u043b\u0438 offline), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0437\u0430 \u0440\u0430\u0437\u0443\u043c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u0443\u0434\u0438\u043e \u0432 \u0442\u0435\u043a\u0441\u0442. \u0421\u0440\u0435\u0434\u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0441\u044f open source \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/github.com\/alphacep\/vosk-api\" rel=\"noopener noreferrer nofollow\">vosk<\/a>. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 offline \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0432 \u043d\u0435\u043c \u0434\u043b\u044f \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u0435\u0441\u0442\u044c \u043a\u0430\u043a \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u0438\u0435 (43 mb) \u0442\u0430\u043a \u0438 \u043e\u0447\u0435\u043d\u044c \u0442\u044f\u0436\u0435\u043b\u044b\u0435 (2.5 gb) \u043c\u043e\u0434\u0435\u043b\u0438, \u0430 \u0432\u044b\u0431\u043e\u0440 &#8212; \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0445\u043e\u0440\u043e\u0448\u043e. \u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/alphacephei.com\/vosk\/models\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435<\/a>. \u041f\u043e\u043c\u0438\u043c\u043e \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e, \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u0443\u043a\u0440\u0430\u0438\u043d\u0441\u043a\u0438\u0439, \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439, \u043d\u0435\u043c\u0435\u0446\u043a\u0438\u0439 \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435. <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438. \u0418\u0437 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439: \u043d\u0430 \u0432\u0445\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0430\u0439\u043b \u0444\u043e\u0440\u043c\u0430\u0442\u0430 wav.<\/p>\n<pre><code class=\"python\">import wave import json import vosk from vosk import KaldiRecognizer   def recognize_phrase(model: vosk.Model, phrase_wav_path: str) -&gt; str:     \"\"\"     Recognize Russian voice in wav     \"\"\"      wave_audio_file = wave.open(phrase_wav_path, \"rb\")     offline_recognizer = KaldiRecognizer(model, 24000)     data = wave_audio_file.readframes(wave_audio_file.getnframes())      offline_recognizer.AcceptWaveform(data)     recognized_data = json.loads(offline_recognizer.Result())[\"text\"]     return recognized_data<\/code><\/pre>\n<p>\u0425\u043e\u0442\u044f offline \u043c\u043e\u0434\u0435\u043b\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043d\u0435 \u0442\u0430\u043a\u0438\u0435 \u0442\u043e\u0447\u043d\u044b\u0435, \u043a\u0430\u043a \u0438\u0445 online \u0430\u043d\u0430\u043b\u043e\u0433\u0438, \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0443\u043a\u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n<p>\u0418\u0437 \u043c\u0438\u043d\u0443\u0441\u043e\u0432 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f: <\/p>\n<ul>\n<li>\n<p>\u041d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u044f\u0437\u044b\u043a\u0435<\/p>\n<\/li>\n<li>\n<p>\u041f\u043b\u043e\u0445\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u043b\u043e\u0432\u0430<\/p>\n<\/li>\n<\/ul>\n<h2>\u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c mongo db. \u0421\u0440\u0435\u0434\u0438 \u044f\u0432\u043d\u044b\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: <\/p>\n<ul>\n<li>\n<p>\u0423\u0434\u043e\u0431\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>\u041b\u0435\u0433\u043a\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0431\u0430\u0437\u0435 mongo db \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0437\u0434\u0435\u0441\u044c \u0436\u0435, \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"python\">import datetime from pymongo.errors import DuplicateKeyError from pymongo.collection import Collection   def add_value(database: Collection, value: str):     \"\"\"     \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445     \"\"\"      database_index = int(datetime.datetime.now().timestamp())     try:         database.insert_one({'_id': database_index, 'text': value})         return True      except DuplicateKeyError:         return False <\/code><\/pre>\n<p>\u0418\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0432\u044b\u0431\u0440\u0430\u043d timestamp \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c: <\/p>\n<ul>\n<li>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \/ \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u0430\u0442 (\u043e\u0434\u043d\u0430 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0430)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u044e\u0437\u0435\u0440\u0430 (\u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u0430)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0432\u044b\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 <\/p>\n<\/li>\n<\/ul>\n<h2>FFmpeg<\/h2>\n<blockquote>\n<p><a href=\"https:\/\/ffmpeg.org\/\" rel=\"noopener noreferrer nofollow\">FFmpeg<\/a>&nbsp;\u2014 \u043d\u0430\u0431\u043e\u0440&nbsp;\u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445&nbsp;\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0441&nbsp;\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435&nbsp;\u0430\u0443\u0434\u0438\u043e- \u0438&nbsp;\u0432\u0438\u0434\u0435\u043e\u0437\u0430\u043f\u0438\u0441\u0438&nbsp;\u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445.<\/p>\n<\/blockquote>\n<p>\u0417\u0430\u0447\u0435\u043c \u043d\u0430\u043c <code>ffmpeg<\/code> ? \u0424\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0430\u0443\u0434\u0438\u043e-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438\u0437 telegram &#8212; \u044d\u0442\u043e <code>ogg<\/code>. \u041d\u043e vosk \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c <code>wav<\/code>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>ffmpeg<\/code> \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 <code>ogg<\/code> \u0432 <code>wav<\/code>.<\/p>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0443\u0434\u0438\u043e \u043d\u0430 python \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e <code>ffmpeg<\/code>. \u041d\u043e \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d <code>ffmpeg<\/code>, \u0437\u0430\u0447\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b? <\/p>\n<pre><code class=\"python\"># \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 ogg \u0432 wav ffmpeg -i .\/my_phrase.ogg  -ar 16000 -ac 2 -ab 192K -f wav .\/my_phrase_to_translite.wav<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0440\u0430\u0437\u0431\u043e\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>-i .\/my_phrase.ogg &#8212; \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445 (\u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0444\u0440\u0430\u0437\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438) <\/p>\n<\/li>\n<li>\n<p><code>-ar 16000<\/code>&#8212; \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0432\u0443\u043a\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. (\u0413\u0446)<\/p>\n<\/li>\n<li>\n<p><code>-ac 2 - <\/code>\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u0443\u0434\u0438\u043e\u043a\u0430\u043d\u0430\u043b\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><code>-ab 192K - <\/code>\u0431\u0438\u0442\u0440\u0435\u0439\u0442<\/p>\n<\/li>\n<li>\n<p><code>-f wav - <\/code>\u0444\u043e\u0440\u043c\u0430\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h2>Docker<\/h2>\n<p>\u041d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0431\u043e\u0442\u0430 \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. <\/p>\n<p>\u0421\u0430\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0435\u0441\u043b\u0438 \u0435\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u041c\u044b \u0436\u0435 \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e: \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0438\u043c\u0435\u043d\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d \u0443\u0436\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u043d\u0435\u0435. <\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438: <\/p>\n<pre><code class=\"bash\">if docker inspect --format '{{json .State.Running}}' mongo_database then   echo \"container is already running\"   exit fi<\/code><\/pre>\n<h2>Telegram bot API<\/h2>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435\u043c\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 telegram, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u043e\u0442\u0430 \u043f\u043e API \u043a\u043b\u044e\u0447\u0443. \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435: <\/p>\n<ol>\n<li>\n<p>\u0423\u0434\u043e\u0431\u043d\u043e\u0435 API<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0447\u0430\u0442\u0430<\/p>\n<\/li>\n<\/ol>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b<\/h2>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/315\/ad7\/fd8\/315ad7fd86b155513a92a016bbf61551.png\" width=\"966\" height=\"888\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u043c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430 \u043d\u0430\u0448\u0438\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u043e \u0443\u0436\u0435 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b35\/194\/197\/b351941971712417ce0ff245e62d3c5b.png\" width=\"984\" height=\"956\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0442\u0435\u043a\u0441\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043b\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u0435\u0440\u043d\u0443\u043b\u0438\u0441\u044c \u0432\u0441\u0435 \u0437\u0430\u043f\u0438\u0441\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d \u0441\u0434\u0435\u043b\u0430\u043b \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 10 \u043c\u0438\u043d\u0443\u0442. <\/p>\n<h2>\u0410 \u0447\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h2>\n<p>\u0421\u0432\u043e\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u044f \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 2021 \u0433\u043e\u0434\u0443. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u044d\u0432\u0440\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \/ machine learning \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0444\u0440\u0430\u0437 \u0438\u043b\u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439. <\/p>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/github.com\/MaximShalankin\/python_voice_diary\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 GitHub<\/a><\/p>\n<\/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\/564924\/\"> https:\/\/habr.com\/ru\/post\/564924\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>\u0417\u0430\u0447\u0435\u043c \u0432\u0441\u0451 \u044d\u0442\u043e? <\/h2>\n<p>\u0412\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0441\u0442\u0435\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u041c\u043d\u043e\u0433\u0438\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438-\u0433\u0438\u0433\u0430\u043d\u0442\u044b \u0441\u0442\u0440\u0435\u043c\u044f\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430. \u041d\u043e \u0440\u0435\u0447\u0435\u0432\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c. \u041a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 <s>\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0435\u0449\u0435 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0435\u0435<\/s> .<\/p>\n<p>\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0434\u043d\u0435\u0432\u043d\u0438\u043a &#8212; \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0432 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. <\/p>\n<h2>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<p>\u0423 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0430 \u0435\u0441\u0442\u044c 4 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0430\u0443\u0434\u0438\u043e\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 <\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0431\u0430\u0437\u0443 <\/p>\n<\/li>\n<li>\n<p>\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0431\u0430\u0437\u044b<\/p>\n<\/li>\n<li>\n<p>\u0438\u043c\u0435\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<figure class=\"float bordered full-width\"><figcaption>\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0442\u0435\u043a \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0430<\/figcaption><\/figure>\n<p>\u0411\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c mongo db \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e <s>\u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e\u0433\u043e<\/s> \u0442\u0435\u043a\u0441\u0442\u0430, docker \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, telegram \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c vosk \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0433\u043e\u043b\u043e\u0441\u0430. <\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435  \u0441 \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u043c\u0438 \u0447\u0430\u0441\u0442\u044f\u043c\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0430. <\/p>\n<h2>\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0434\u0432\u0438\u0436\u043e\u043a<\/h2>\n<p>\u0414\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0433\u043e\u043b\u043e\u0441\u0430 \u043d\u0443\u0436\u043d\u0430 \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c (online \u0438\u043b\u0438 offline), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0437\u0430 \u0440\u0430\u0437\u0443\u043c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u0443\u0434\u0438\u043e \u0432 \u0442\u0435\u043a\u0441\u0442. \u0421\u0440\u0435\u0434\u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0441\u044f open source \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/github.com\/alphacep\/vosk-api\" rel=\"noopener noreferrer nofollow\">vosk<\/a>. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 offline \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0432 \u043d\u0435\u043c \u0434\u043b\u044f \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u0435\u0441\u0442\u044c \u043a\u0430\u043a \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u0438\u0435 (43 mb) \u0442\u0430\u043a \u0438 \u043e\u0447\u0435\u043d\u044c \u0442\u044f\u0436\u0435\u043b\u044b\u0435 (2.5 gb) \u043c\u043e\u0434\u0435\u043b\u0438, \u0430 \u0432\u044b\u0431\u043e\u0440 &#8212; \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0445\u043e\u0440\u043e\u0448\u043e. \u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/alphacephei.com\/vosk\/models\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435<\/a>. \u041f\u043e\u043c\u0438\u043c\u043e \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e, \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u0443\u043a\u0440\u0430\u0438\u043d\u0441\u043a\u0438\u0439, \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439, \u043d\u0435\u043c\u0435\u0446\u043a\u0438\u0439 \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435. <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438. \u0418\u0437 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439: \u043d\u0430 \u0432\u0445\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0430\u0439\u043b \u0444\u043e\u0440\u043c\u0430\u0442\u0430 wav.<\/p>\n<pre><code class=\"python\">import wave import json import vosk from vosk import KaldiRecognizer   def recognize_phrase(model: vosk.Model, phrase_wav_path: str) -&gt; str:     \"\"\"     Recognize Russian voice in wav     \"\"\"      wave_audio_file = wave.open(phrase_wav_path, \"rb\")     offline_recognizer = KaldiRecognizer(model, 24000)     data = wave_audio_file.readframes(wave_audio_file.getnframes())      offline_recognizer.AcceptWaveform(data)     recognized_data = json.loads(offline_recognizer.Result())[\"text\"]     return recognized_data<\/code><\/pre>\n<p>\u0425\u043e\u0442\u044f offline \u043c\u043e\u0434\u0435\u043b\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043d\u0435 \u0442\u0430\u043a\u0438\u0435 \u0442\u043e\u0447\u043d\u044b\u0435, \u043a\u0430\u043a \u0438\u0445 online \u0430\u043d\u0430\u043b\u043e\u0433\u0438, \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0443\u043a\u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n<p>\u0418\u0437 \u043c\u0438\u043d\u0443\u0441\u043e\u0432 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f: <\/p>\n<ul>\n<li>\n<p>\u041d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u044f\u0437\u044b\u043a\u0435<\/p>\n<\/li>\n<li>\n<p>\u041f\u043b\u043e\u0445\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u043b\u043e\u0432\u0430<\/p>\n<\/li>\n<\/ul>\n<h2>\u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c mongo db. \u0421\u0440\u0435\u0434\u0438 \u044f\u0432\u043d\u044b\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: <\/p>\n<ul>\n<li>\n<p>\u0423\u0434\u043e\u0431\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>\u041b\u0435\u0433\u043a\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0431\u0430\u0437\u0435 mongo db \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0437\u0434\u0435\u0441\u044c \u0436\u0435, \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"python\">import datetime from pymongo.errors import DuplicateKeyError from pymongo.collection import Collection   def add_value(database: Collection, value: str):     \"\"\"     \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445     \"\"\"      database_index = int(datetime.datetime.now().timestamp())     try:         database.insert_one({'_id': database_index, 'text': value})         return True      except DuplicateKeyError:         return False <\/code><\/pre>\n<p>\u0418\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0432\u044b\u0431\u0440\u0430\u043d timestamp \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c: <\/p>\n<ul>\n<li>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \/ \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u0430\u0442 (\u043e\u0434\u043d\u0430 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0430)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u044e\u0437\u0435\u0440\u0430 (\u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u0430)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0432\u044b\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 <\/p>\n<\/li>\n<\/ul>\n<h2>FFmpeg<\/h2>\n<blockquote>\n<p><a href=\"https:\/\/ffmpeg.org\/\" rel=\"noopener noreferrer nofollow\">FFmpeg<\/a>&nbsp;\u2014 \u043d\u0430\u0431\u043e\u0440&nbsp;\u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445&nbsp;\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0441&nbsp;\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435&nbsp;\u0430\u0443\u0434\u0438\u043e- \u0438&nbsp;\u0432\u0438\u0434\u0435\u043e\u0437\u0430\u043f\u0438\u0441\u0438&nbsp;\u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445.<\/p>\n<\/blockquote>\n<p>\u0417\u0430\u0447\u0435\u043c \u043d\u0430\u043c <code>ffmpeg<\/code> ? \u0424\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0430\u0443\u0434\u0438\u043e-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438\u0437 telegram &#8212; \u044d\u0442\u043e <code>ogg<\/code>. \u041d\u043e vosk \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c <code>wav<\/code>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>ffmpeg<\/code> \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 <code>ogg<\/code> \u0432 <code>wav<\/code>.<\/p>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0443\u0434\u0438\u043e \u043d\u0430 python \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e <code>ffmpeg<\/code>. \u041d\u043e \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d <code>ffmpeg<\/code>, \u0437\u0430\u0447\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b? <\/p>\n<pre><code class=\"python\"># \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 ogg \u0432 wav ffmpeg -i .\/my_phrase.ogg  -ar 16000 -ac 2 -ab 192K -f wav .\/my_phrase_to_translite.wav<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0440\u0430\u0437\u0431\u043e\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>-i .\/my_phrase.ogg &#8212; \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445 (\u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0444\u0440\u0430\u0437\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438) <\/p>\n<\/li>\n<li>\n<p><code>-ar 16000<\/code>&#8212; \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0432\u0443\u043a\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. (\u0413\u0446)<\/p>\n<\/li>\n<li>\n<p><code>-ac 2 - <\/code>\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u0443\u0434\u0438\u043e\u043a\u0430\u043d\u0430\u043b\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><code>-ab 192K - <\/code>\u0431\u0438\u0442\u0440\u0435\u0439\u0442<\/p>\n<\/li>\n<li>\n<p><code>-f wav - <\/code>\u0444\u043e\u0440\u043c\u0430\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h2>Docker<\/h2>\n<p>\u041d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0431\u043e\u0442\u0430 \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. <\/p>\n<p>\u0421\u0430\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0435\u0441\u043b\u0438 \u0435\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u041c\u044b \u0436\u0435 \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e: \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0438\u043c\u0435\u043d\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d \u0443\u0436\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u043d\u0435\u0435. <\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438: <\/p>\n<pre><code class=\"bash\">if docker inspect --format '{{json .State.Running}}' mongo_database then   echo \"container is already running\"   exit fi<\/code><\/pre>\n<h2>Telegram bot API<\/h2>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435\u043c\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 telegram, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u043e\u0442\u0430 \u043f\u043e API \u043a\u043b\u044e\u0447\u0443. \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435: <\/p>\n<ol>\n<li>\n<p>\u0423\u0434\u043e\u0431\u043d\u043e\u0435 API<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0447\u0430\u0442\u0430<\/p>\n<\/li>\n<\/ol>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b<\/h2>\n<figure class=\"bordered full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u043c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430 \u043d\u0430\u0448\u0438\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u043e \u0443\u0436\u0435 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<figure class=\"bordered full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0442\u0435\u043a\u0441\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043b\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u0435\u0440\u043d\u0443\u043b\u0438\u0441\u044c \u0432\u0441\u0435 \u0437\u0430\u043f\u0438\u0441\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d \u0441\u0434\u0435\u043b\u0430\u043b \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 10 \u043c\u0438\u043d\u0443\u0442. <\/p>\n<h2>\u0410 \u0447\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h2>\n<p>\u0421\u0432\u043e\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u044f \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 2021 \u0433\u043e\u0434\u0443. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u044d\u0432\u0440\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \/ machine learning \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0444\u0440\u0430\u0437 \u0438\u043b\u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439. <\/p>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/github.com\/MaximShalankin\/python_voice_diary\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 GitHub<\/a><\/p>\n<\/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\/564924\/\"> https:\/\/habr.com\/ru\/post\/564924\/<\/a><br \/><\/br><\/br><\/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-325559","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325559","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=325559"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325559\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=325559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=325559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=325559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}