{"id":350509,"date":"2023-07-19T15:03:23","date_gmt":"2023-07-19T15:03:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=350509"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=350509","title":{"rendered":"<span>VoiceChat \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0441 \u0431\u043b\u044d\u043a\u0434\u0436\u0435\u043a\u043e\u043c \u0438 (Web?)UI \u043d\u0430\u0434 UDP socket python<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/38a\/65b\/7ed\/38a65b7ed60c9769d50fa2d3b0537c62.jpg\" alt=\"\u0420\u0443\u0433\u0430\u0435\u0442 VoIP, discord \u0438 \u0434\u0440. \u0437\u0430 \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a\" title=\"\u0420\u0443\u0433\u0430\u0435\u0442 VoIP, discord \u0438 \u0434\u0440. \u0437\u0430 \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a\" width=\"660\" height=\"330\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/38a\/65b\/7ed\/38a65b7ed60c9769d50fa2d3b0537c62.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0420\u0443\u0433\u0430\u0435\u0442 VoIP, discord \u0438 \u0434\u0440. \u0437\u0430 <a href=\"https:\/\/neolurk.org\/wiki\/%D0%A4%D0%B0%D1%82%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9_%D0%BD%D0%B5%D0%B4%D0%BE%D1%81%D1%82%D0%B0%D1%82%D0%BE%D0%BA\" rel=\"noopener noreferrer nofollow\">\u0444\u0430\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a<\/a><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0430\u0440\u0443 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u044d\u0442\u0438 \u0433\u0438\u0442<a href=\"https:\/\/habr.com\/ru\/users\/CodeDroidX\/posts\/\" rel=\"noopener noreferrer nofollow\">\u0445\u0430\u0431\u0440\u044b<\/a> \u0434\u043b\u044f\u00a0\u043c\u0435\u043d\u044f\u00a0\u0431\u044b\u043b\u0438 \u043f\u0442\u0438\u0447\u044c\u0438\u043c \u043f\u0435\u043d\u0438\u0435\u043c, \u0430\u00a0\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043d\u0435\u00a0\u0431\u044b\u043b\u043e \u043d\u0435\u0447\u0435\u0433\u043e\u00a0\u2014 \u043f\u0438\u0441\u0430\u043b \u044f \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0430\u00a0python. \u0421\u0440\u0435\u0434\u0438 \u043d\u0438\u0445\u00a0\u0431\u044b\u043b \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0447\u0430\u0442 \u043d\u0430\u00a0\u0434\u0432\u043e\u0438\u0445 \u0447\u0435\u0440\u0435\u0437 TCP. \u041d\u043e\u00a0\u0432\u043e\u0442 \u044f \u043d\u0430\u0448\u0435\u043b \u0435\u0433\u043e \u0438 \u0437\u0430\u0445\u043e\u0442\u0435\u043b \u0434\u043e\u043f\u0438\u043b\u0438\u0442\u044c. \u041b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u043f\u0438\u043b\u0438\u0442\u044c \u0447\u0442\u043e\u2011\u0442\u043e\u00a0\u2014 \u044d\u0442\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e. <abbr class=\"habraabbr\" title=\"\u0422\u0430\u043c, \u043f\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0431\u0443\u0434\u0435\u0442 \u0442\u0430 \u0435\u0449\u0451 \u0434\u0438\u0447\u044c\" data-title=\"&lt;p>\u0422\u0430\u043c, \u043f\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0431\u0443\u0434\u0435\u0442 \u0442\u0430 \u0435\u0449\u0451 \u0434\u0438\u0447\u044c&lt;\/p>&#187; data-abbr=&#187;\u0412\u0441\u0451 \u0447\u0442\u043e \u0432\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0434\u0430\u043b\u0435\u0435&#187;>\u0412\u0441\u0451 \u0447\u0442\u043e\u00a0\u0432\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0434\u0430\u043b\u0435\u0435<\/abbr>\u00a0\u2014 \u0435\u0441\u0442\u044c \u043c\u043e\u0439 \u0433\u0430\u0439\u0434 \u043f\u043e\u00a0\u0438\u0437\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044e \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430 \u0438 \u043d\u0435\u00a0\u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430\u00a0\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. <\/p>\n<hr\/>\n<p>\u0412\u043e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u043e\u0438\u043d\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0441 \u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043c\u043d\u043e\u0439 \u043e\u043f\u044b\u0442\u0430: <\/p>\n<ul>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0435 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0447\u0430\u0441\u0442\u0438: <\/p>\n<ul>\n<li>\n<p>1. <strong>Sender<\/strong> <strong><em>(I)<\/em><\/strong> \u0447\u0438\u0442\u0430\u0435\u0442 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>2. <strong>Receiver<\/strong> <strong><em>(O)<\/em><\/strong> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0432\u0441\u0435 \u0430\u0443\u0434\u0438\u043e\u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0438\u0445 \u0432 \u043d\u0430\u0443\u0448\u043d\u0438\u043a\u0438<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0422\u044b \u043c\u043e\u0436\u0435\u0448\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0433\u043e\u043b\u043e\u0441 \u043a\u043e\u043c\u0443 \u0443\u0433\u043e\u0434\u043d\u043e, \u043d\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0448\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043f\u043e\u0434\u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0447\u0443\u0436\u043e\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e \u043d\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443:<\/p>\n<ul>\n<li>\n<p>\u0422\u044b \u0441\u043b\u044b\u0448\u0438\u0448\u044c \u0432\u0441\u0451, \u0447\u0442\u043e \u0442\u0435\u0431\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 (\u043d\u043e \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0437\u0432\u0443\u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 aka \u0447\u0435\u0440\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a)<\/p>\n<\/li>\n<li>\n<p>\u0422\u044b \u043c\u043e\u0436\u0435\u0448\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0433\u043e\u043b\u043e\u0441 \u043a\u043e\u043c\u0443 \u0443\u0433\u043e\u0434\u043d\u043e, \u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0435\u0448\u044c \u0435\u0433\u043e IP \u0430\u0434\u0440\u0435\u0441.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>TCP \u0438\u043b\u0438 UDP?<\/h2>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u043d\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438:<\/p>\n<ul>\n<li>\n<p><strong>TCP<\/strong>:<\/p>\n<ul>\n<li>\n<p>+ \u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0430\u043a \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0443\u0434\u0438\u043e\u043f\u043e\u0442\u043e\u043a \u043e\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043b\u044e\u0434\u0435\u0439 &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0432\u0441\u0435\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>&#8212; \u0415\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e \u0441\u0435\u0441\u0441\u0438\u0438 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u043c &#8212; \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0438\u0445 \u043c\u043d\u043e\u0433\u043e.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>UDP<\/strong>:<\/p>\n<ul>\n<li>\n<p>+ \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0435\u0441\u0441\u0438\u0438 (\u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0438\u0434\u0430\u0435\u0448\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443)<\/p>\n<\/li>\n<li>\n<p>&#8212; \u041f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u043e\u0442 \u043a\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u043b-\u0432\u0430 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u043e\u043d\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 (\u0432\u0441\u0435 \u0432\u043f\u0435\u0440\u0435\u043c\u0435\u0448\u043a\u0443)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>UDP \u0431\u043e\u043b\u0435\u0435 \u0441\u0445\u043e\u0436 \u0441 \u043c\u043e\u0438\u043c \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u043e\u043c \u0438 \u0443\u0434\u043e\u0431\u0435\u043d \u043a\u043e\u0433\u0434\u0430 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u043c\u043d\u043e\u0433\u043e &#8212; <\/strong>\u0435\u0433\u043e \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c84\/4ae\/965\/c844ae96568bf154b79a530556c34a04.png\" alt=\"\u041d\u0430\u0434\u0451\u0436\u043d\u044b\u0439 \u043f\u043b\u0430\u043d \u0440\u0430\u0431\u043e\u0442\u044b voicechata \u0447\u0435\u0440\u0435\u0437 UDP\" title=\"\u041d\u0430\u0434\u0451\u0436\u043d\u044b\u0439 \u043f\u043b\u0430\u043d \u0440\u0430\u0431\u043e\u0442\u044b voicechata \u0447\u0435\u0440\u0435\u0437 UDP\" width=\"693\" height=\"364\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c84\/4ae\/965\/c844ae96568bf154b79a530556c34a04.png\"\/><\/p>\n<div><figcaption>\u041d\u0430\u0434\u0451\u0436\u043d\u044b\u0439 \u043f\u043b\u0430\u043d \u0440\u0430\u0431\u043e\u0442\u044b voicechata \u0447\u0435\u0440\u0435\u0437 UDP<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e, \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043b\u0438\u0434\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/articles\/157287\/\" rel=\"noopener noreferrer nofollow\"><u>venv<\/u><\/a>.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0441\u0440\u0435\u0434\u044b<\/h2>\n<pre><code class=\"bash\">mkdir pycord cd pycord python -m venv venv venv\\scripts\\activate  pip install numpy pip install pyaudio<\/code><\/pre>\n<p>C\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443, \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b\u0438\u043a PyCord.py.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043f\u043e\u0439\u043b\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u0435\u0440\u044c\u0451\u0437\u043d\u043e, \u043d\u0438\u043a\u0430\u043a\u0438\u0445, api, \u0442\u0435\u0441\u0442\u043e\u0432\u00a0\u2014 \u0444\u0443\u043b\u0441\u0442\u0430\u043a \u0432\u0430\u043c \u043f\u0443\u0445\u043e\u043c.<\/p>\n<\/div>\n<\/details>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0442\u043e, \u0447\u0442\u043e\u00a0\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f.<\/p>\n<pre><code class=\"python\">import pyaudio import socket import numpy as np from threading import Thread<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c IO \u0434\u043b\u044f\u00a0\u0430\u0443\u0434\u0438\u043e\u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<blockquote>\n<p>Pyaudio\u00a0\u2014 \u0441\u0430\u043c\u0430\u044f \u0438\u0437\u044f\u0449\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b. \u0421\u043e\u0437\u0434\u0430\u0435\u0448\u044c \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u00a0\u0431\u0443\u0444\u0435\u0440\u0430\u043c\u0438 \u0432\u0432\u043e\u0434\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434\u0430\u00a0\u2014 \u043f\u0438\u0448\u0435\u0448\u044c, \u0447\u0438\u0442\u0430\u0435\u0448\u044c, \u0432\u0441\u0435 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<\/blockquote>\n<pre><code class=\"python\">CHUNK=2048 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 44100 p = pyaudio.PyAudio()  stream=p.open(format=FORMAT, # \u042d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u043c IO \u0433\u043e\u043b\u043e\u0441\u0430             channels=CHANNELS,             rate=RATE,             input=True,                 output=True,             frames_per_buffer=CHUNK)<\/code><\/pre>\n<h2>Sender (Audio stream -> IPs from list)<\/h2>\n<p>\u041f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434:<\/p>\n<ol>\n<li>\n<p>\u0427\u0438\u0442\u0430\u0435\u043c \u043a\u0443\u0441\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 (\u0434\u0430\u043b\u0435\u0435 <em>\u0447\u0430\u043d\u043a<\/em>) \u0438\u0437\u00a0\u0430\u0443\u0434\u0438\u043e\u043f\u043e\u0442\u043e\u043a\u0430. <\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437\u00a0\u0441\u043f\u0438\u0441\u043a\u0430 clients, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u0438\u0437\u00a0get_clients()\u00a0\u2014 \u043e\u0431\u00a0\u044d\u0442\u043e\u043c \u0434\u0430\u043b\u0435\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0434\u043e\u00a0\u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438 \u043f\u0443\u043d\u043a\u0442\u044b 1\u00a0\u0438 2.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">def Sender():     UDP_PORT = 6006      sock = socket.socket(socket.AF_INET,                         socket.SOCK_DGRAM)     while True:         clients = get_clients() #\u043f\u043e\u043a\u0430 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b         data = stream.read(CHUNK, exception_on_overflow = False)         for addr in clients:             sock.sendto(data, (addr, UDP_PORT))<\/code><\/pre>\n<h2>Receiver (Internet -> Audio stream)<\/h2>\n<p>\u0415\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u043d\u044e\u0430\u043d\u0441, <strong>recvfrom<\/strong> \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f <em>\u0447\u0430\u043d\u043a\u0430<\/em> \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u0434\u0438\u0430\u043b\u043e\u0433\u0435 \u0434\u0432\u0443\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442:<\/p>\n<pre><code class=\"python\">def Receiver():     me = \"127.0.0.1\"     UDP_PORT = 6006      sock = socket.socket(socket.AF_INET,                         socket.SOCK_DGRAM)     sock.bind((me, UDP_PORT))      while True:         num = get_num() #\u043f\u043e\u043a\u0430 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b         for i in range(num):             new = np.frombuffer(sock.recvfrom(CHUNK*10)[0],dtype=np.uint16)             if i == 0:                 data = new.copy()             else:                 data += new         if num != 0:             print(data.shape)             stream.write(data.tobytes())<\/code><\/pre>\n<ul>\n<li>\n<p>\u0447\u0435\u043b\u043e\u0432\u0435\u043a \u21161 \u0437\u0430\u043f\u0438\u0441\u0430\u043b <em>\u0447\u0430\u043d\u043a<\/em> \u0437\u0430 1\/n \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0435\u0433\u043e.<\/p>\n<\/li>\n<li>\n<p>\u0447\u0435\u043b\u043e\u0432\u0435\u043a \u21162 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0435\u0433\u043e \u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 1\/n \u0441\u0435\u043a\u0443\u043d\u0434\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c <em>\u0447\u0430\u043d\u043a\u0438<\/em> \u0441\u0440\u0430\u0437\u0443 \u043e\u0442 \u0434\u0432\u0443\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u043a:<\/p>\n<ul>\n<li>\n<p>\u0447\u0435\u043b\u043e\u0432\u0435\u043a \u21161 \u0437\u0430\u043f\u0438\u0441\u0430\u043b <em>\u0447\u0430\u043d\u043a<\/em> \u21161 \u0437\u0430 1\/n \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0435\u0433\u043e<\/p>\n<\/li>\n<li>\n<p>\u0447\u0435\u043b\u043e\u0432\u0435\u043a \u21162 \u0437\u0430\u043f\u0438\u0441\u0430\u043b <em>\u0447\u0430\u043d\u043a<\/em> \u21162 \u0437\u0430 1\/n \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0435\u0433\u043e<\/p>\n<\/li>\n<li>\n<p>\u0447\u0435\u043b\u043e\u0432\u0435\u043a \u21163 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 2*1\/n \u0441\u0435\u043a\u0443\u043d\u0434\u044b<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u21163 \u0442\u043e\u0440\u043c\u043e\u0437! \u0415\u0433\u043e \u0431\u0443\u0444\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0442\u0451\u0442, \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043c\u0435\u0442\u044c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c <em>\u0447\u0430\u043d\u043a\u0438<\/em> \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0430\u0443\u0434\u0438\u043e\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e: \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432\u044b numpy.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 <em>recvfrom<\/em> \u0442\u0430\u043a: <strong>sock.setblocking(0)<\/strong><\/p>\n<ol>\n<li>\n<p>\u0421\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u043c \u0447\u0430\u043d\u043a\u0438 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u044b\u043f\u0430\u0434\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043e \u043f\u0443\u0441\u0442\u043e\u0442\u0435 \u0431\u0443\u0444\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0437\u0432\u0443\u043a \u0441 \u0447\u0438\u0441\u0442\u043e\u0439 \u0441\u043e\u0432\u0435\u0441\u0442\u044c\u044e \u043f\u0438\u0448\u0435\u043c \u0432 \u0430\u0443\u0434\u0438\u043e\u043f\u043e\u0442\u043e\u043a.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">def Receiver():     me = \"127.0.0.1\"     UDP_PORT = 6006      sock = socket.socket(socket.AF_INET,                         socket.SOCK_DGRAM)     sock.setblocking(0)     sock.bind((me, UDP_PORT))       while True:         c = 0         first = True         while True:             blacklist = get_black() #\u043f\u043e\u043a\u0430 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b             try:                 d,addr = sock.recvfrom(CHUNK*10)                 if addr[0] in blacklist:                     continue                 new = np.frombuffer(d,dtype=np.uint16)                 c += 1                 if first:                     data = new.copy()                     first = False                 else:                     data += new             except:                 break         if not first:             #print(c)             stream.write(data.tobytes())<\/code><\/pre>\n<blockquote>\n<p>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 get_black() \u0434\u043b\u044f \u0427\u0421 \u0438 get_clients() \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u0432\u043e\u0435\u0433\u043e \u0433\u043e\u043b\u043e\u0441\u0430<\/p>\n<\/blockquote>\n<h2>Getters &amp; setters \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f clients, blacklist<\/h2>\n<pre><code class=\"python\">black,clients=[],[]  def set_black(s):     global black     black = s       def get_black():     global black     return black       def set_clients(s):     global clients     clients = s       def get_clients():     global clients     return clients<\/code><\/pre>\n<h2>\u041a\u0430\u043a \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 Reciver \u0438 Sender<\/h2>\n<pre><code class=\"python\">sender = Thread(target=Sender, args=()) sender.start()  recv = Thread(target=Receiver, args=()) recv.start()<\/code><\/pre>\n<p>\u041e\u0431\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u043a\u0430\u043a \u043f\u043e\u0442\u043e\u043a\u0438, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e, \u043a\u0430\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435?<\/p>\n<pre><code class=\"python\">set_black([\"192.168.0.1\"]) # \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0445 \u0430\u0443\u0434\u0438\u043e\u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 2 set_clients([\"127.0.0.1\",\"192.168.0.15\"]) #\u0422\u0435\u043f\u0435\u0440\u044c \u0430\u0443\u0434\u0438\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0431\u0430 \u0430\u0434\u0440\u0435\u0441\u0430<\/code><\/pre>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u0430, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c.<\/p>\n<p>\u041e \u043d\u0451\u043c \u0441\u0435\u0439\u0447\u0430\u0441 \u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c.<\/p>\n<h2>UI<\/h2>\n<p>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0434\u0442\u0438 \u043f\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0439 \u0434\u043e\u0440\u043e\u0436\u043a\u0435, \u0438\u043c\u0435\u043d\u0443\u0435\u043c\u043e\u0439 <strong>Tk<\/strong>, \u0438\u043b\u0438 \u0441\u0445\u043e\u0436\u0435\u0439, \u043d\u043e \u0447\u0443\u0442\u044c \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0439 <strong>Qt<\/strong>, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0434\u0430\u0436\u0435 \u0443\u043f\u043e\u0440\u043e\u0442\u044c\u0441\u044f \u0432 \u0441\u0442\u0438\u043b\u044c \u0441 <strong>DearPyGui<\/strong>, \u043d\u043e \u044d\u0442\u043e \u0432\u0441\u0451 \u0437\u0430\u0435\u0437\u0436\u0435\u043d\u043e \u0438 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0418 \u0442\u0443\u0442 \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b: \u0410 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441?. \u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 &#8212;  <strong>Gradio.<\/strong><\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441 \u0432\u0435\u0431 \u0444\u0440\u043e\u043d\u0442\u043e\u043c, \u0430 \u0437\u0430\u043f\u0430\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0444\u0440\u043e\u043d\u0442\u044d\u043d\u0434\u043e\u043c \u043d\u0430 JS \u0438 \u0434\u0430\u0436\u0435 api \u043d\u0435 \u0443\u043c\u0435\u0441\u0442\u043d\u043e, \u0435\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0435\u0448\u044c \u0447\u0442\u043e-\u0442\u043e \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u043e\u0435 \u0432\u0440\u043e\u0434\u0435 \u043c\u043e\u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430. <\/p>\n<p>\u0417\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0443 \u043c\u0438\u043d\u0443\u0442 \u044f \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0443\u043c\u0430\u043b &#8212; \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439 \u0441\u0435\u0440\u044c\u0451\u0437\u0435\u043d \u043a\u0430\u043a \u043d\u0438\u043a\u043e\u0433\u0434\u0430.<\/p>\n<pre><code class=\"bash\">pip install gradio<\/code><\/pre>\n<pre><code class=\"python\">import gradio as gr<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0421\u043f\u043e\u0439\u043b\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0414\u0443\u043c\u0430\u044e, \u0432\u0441\u0451 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f, <em>\u0442\u0430\u043a \u0435\u0449\u0451 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f PyCord c \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0438\u043b\u0438\u00a0\u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043f\u043e\u00a0\u0432\u0435\u0431 \u043c\u0430\u0439\u043a\u0435 Gradio.<\/em><\/p>\n<\/div>\n<\/details>\n<p>Gradio \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u0442\u044c webui \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e backend\u0430 \u043f\u0440\u044f\u043c\u043e \u0432 \u0435\u0433\u043e \u043a\u043e\u0434\u0435, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430.<\/p>\n<p>WebUI \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u0432\u0435 \u0432\u043a\u043b\u0430\u0434\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c<\/p>\n<ul>\n<li>\n<p>\u0421\u043b\u0430\u0439\u0434\u0435\u0440 \u0432\u044b\u0431\u043e\u0440\u0430 \u043a\u043e\u043b-\u0432\u0430 \u0430\u0434\u0440\u0435\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0435\u0439 \u0432\u0432\u043e\u0434\u0430 \u043f\u043e\u0434 \u044d\u0442\u0438 \u0430\u0434\u0440\u0435\u0441\u0430<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0427\u0451\u0440\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a<\/p>\n<ul>\n<li>\n<p>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0447\u0451\u0440\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">import gradio as gr  def variable_outputs(k):     k = int(k)     return [gr.Textbox.update(visible=True)]*k + [gr.Textbox.update(visible=False)]*(max_textboxes-k)     max_textboxes = 10 with gr.Blocks() as demo:     gr.Markdown(\"PyCord\")      with gr.Tab(\"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\"):         snd = gr.Slider(0, max_textboxes, value=10, step=1, label=\"\u0410\u0434\u0440\u0435\u0441\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u0435\u0439\")         textboxes = []         for i in range(max_textboxes):             t = gr.Textbox(f\"127.0.0.1\")             textboxes.append(t)         snd.change(variable_outputs, snd, textboxes)         button = gr.Button(\"\u041d\u0430\u0447\u0430\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443\")         button.click(lambda *s:set_clients(s[:s[-1]]),textboxes+[snd])      with gr.Tab(\"\u0427\u0451\u0440\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a\"):         snd2 = gr.Slider(0, max_textboxes, value=10, step=1, label=\"\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441 \u0430\u0434\u0440\u0435\u0441\u043e\u0432\")         textboxes2 = []         for i in range(max_textboxes):             t = gr.Textbox(f\"127.0.0.1\")             textboxes2.append(t)         snd2.change(variable_outputs, snd2, textboxes2)         button2 = gr.Button(\"\u0411\u0410\u041d\")         button2.click(lambda *s:set_black(s[:s[-1]]),textboxes2+[snd2])  <\/code><\/pre>\n<blockquote>\n<p><em>&#171;Gradio<\/em>\u00a0is the fastest way to demo your machine learning model with a friendly web interface so that anyone can use it, anywhere!&#187;  &#8212; \u044f \u0437\u043d\u0430\u043b \u043d\u0430 \u0447\u0442\u043e \u0448\u0451\u043b, \u0447\u0435\u0441\u0442\u043d\u043e<\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/034\/1bf\/186\/0341bf1863c6b87ff65ad59bd436cfd8.png\" alt=\"Sender\" title=\"Sender\" width=\"1543\" height=\"421\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/034\/1bf\/186\/0341bf1863c6b87ff65ad59bd436cfd8.png\"\/><\/p>\n<div><figcaption>Sender<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/290\/ba4\/94b\/290ba494b7b2df3a57c7abfc2e2271a2.png\" alt=\"Receiver\" title=\"Receiver\" width=\"1559\" height=\"462\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/290\/ba4\/94b\/290ba494b7b2df3a57c7abfc2e2271a2.png\"\/><\/p>\n<div><figcaption>Receiver<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0435\u043b\u0430\u0442\u044c Webui \u043a\u00a0\u044d\u0442\u043e\u043c\u0443 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0443\u00a0\u0431\u044b\u043b\u0430 \u0434\u0438\u043a\u043e\u0441\u0442\u044c, \u0437\u043d\u0430\u044e. \u0417\u0430\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u043d\u0430\u00a0\u043f\u043a \u0438\u0437\u00a0\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u043d\u0430\u00a0\u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435!<\/p>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/902\/ddb\/3a8\/902ddb3a85cdb5b6937a59f0f50e050d.png\" alt=\"\u043a\u0430\u043a \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c - \u043d\u043e \u043d\u0435\u0442\" title=\"\u043a\u0430\u043a \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c - \u043d\u043e \u043d\u0435\u0442\" width=\"576\" height=\"1148\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/902\/ddb\/3a8\/902ddb3a85cdb5b6937a59f0f50e050d.png\"\/><\/p>\n<div><figcaption>\u043a\u0430\u043a \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c &#8212; \u043d\u043e \u043d\u0435\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e\u00a0\u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u0441\u0451 \u0435\u0449\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u00a0\u041f\u041a, \u0430\u00a0\u044d\u0442\u043e \u00ab\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0430\u00a0\u0432\u044b\u043d\u043e\u0441\u00bb.<\/p>\n<p>\u041d\u0430\u00a0\u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u0430\u0436\u0435 \u043d\u0435\u00a0\u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0443\u0441\u0442\u044b\u043c.<\/p>\n<p>\u041d\u043e\u00a0\u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0451 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f gradio \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u043d\u0430\u00a0\u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435\u00a0\u2014 \u044d\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f.<\/p>\n<p>\u0422\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0448\u044c \u043f\u0430\u043b\u044c\u0446\u0435\u043c \u043c\u0438\u043c\u043e \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430\/\u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u00a0\u044d\u0442\u043e \u0441\u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c&#8230; \u041d\u043e\u00a0\u043e\u0449\u0443\u0449\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0435\u00a0\u0432\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u043e\u0434\u0438\u043d \u044d\u043a\u0440\u0430\u043d \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430, \u0438 \u0442\u044b \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u043f\u0435\u0440\u0435\u043c\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441\u0432\u0430\u0439\u043f\u0430\u043c\u0438.<\/p>\n<h2>\u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e<\/h2>\n<p>\u041d\u043e\u00a0\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u044f \u043f\u043e\u043d\u044f\u043b\u00a0\u2014 \u043f\u043e\u0447\u0435\u043c\u0443 gradio \u043d\u0435\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432\u00a0\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043a\u0435\u0439\u0441\u0430\u0445: \u043e\u043d\u043e \u043e\u0447\u0435\u043d\u044c, \u043e\u0447\u0435\u043d\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0435<\/p>\n<p>\u041e\u043d\u043e \u0434\u043e\u043b\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0444\u0440\u0435\u0439\u043c\u044b, \u043e\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u043b\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442. \u042d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u0439, \u043e\u043d \u043b\u043e\u0432\u0438\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043f\u0440\u0438\u00a0\u0441\u0432\u0430\u0439\u043f\u0430\u0445 \u043d\u0430\u00a0\u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435. \u041f\u0440\u0438\u00a0\u0432\u0441\u0451\u043c \u044d\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0434\u00a0Tk \u043d\u0435\u00a0\u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430 (\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f\u00a0\u0431\u044b\u043b\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u00a0\u043d\u0435\u0433\u043e, \u043d\u043e\u00a0\u043f\u043e\u0442\u043e\u043c \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0447\u0442\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u043e\u0435).<\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u043d\u0430 TCP<\/summary>\n<div class=\"spoiler__content\">\n<p><a href=\"https:\/\/github.com\/CodeDruidX\/PyCord\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/CodeDruidX\/PyCord<\/a><\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">import pyaudio import socket import struct import random import numpy as np  from threading import Thread import gradio as gr   IP = socket.gethostbyname(socket.gethostname())    #\u0421\u0432\u043e\u0439 \u0430\u0439\u043f\u0438   CHUNK=1024 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 44100 p = pyaudio.PyAudio()  stream=p.open(format=FORMAT,             channels=CHANNELS,             rate=RATE,             input=True,             output=True,             frames_per_buffer=CHUNK)     black,clients = [],[] def set_black(s):     global black     black = s       def get_black():     global black     return black     def set_clients(s):     global clients     clients = s       def get_clients():     global clients     return clients     def Sender():     UDP_PORT = 6006      sock = socket.socket(socket.AF_INET,                         socket.SOCK_DGRAM)     while True:         clients=get_clients()         data = stream.read(CHUNK, exception_on_overflow = False)         #print(len(data))         for addr in clients:             sock.sendto(data, (addr, UDP_PORT))    def Receiver():     me = \"127.0.0.1\"     UDP_PORT = 6006      sock = socket.socket(socket.AF_INET,                         socket.SOCK_DGRAM)     sock.setblocking(0)     sock.bind((me, UDP_PORT))       while True:         c = 0         first = True         while True:             blacklist = get_black()             try:                 d,addr = sock.recvfrom(CHUNK*10)                 if addr[0] in blacklist:                     continue                 new = np.frombuffer(d,dtype=np.uint16) # buffer size is 1024 bytes                 c += 1                 if first:                     data = new.copy()                     first = False                 else:                     data+=new             except:                 break         if not first:             #print(c)             stream.write(data.tobytes())     def variable_outputs(k):     k = int(k)     return [gr.Textbox.update(visible=True)]*k + [gr.Textbox.update(visible=False)]*(max_textboxes-k)   max_textboxes = 10 with gr.Blocks() as demo:     gr.Markdown(\"# PyCord\")     with gr.Tab(\"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\"):         snd = gr.Slider(0, max_textboxes, value=10, step=1, label=\"\u0410\u0434\u0440\u0435\u0441\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u0435\u0439\")         textboxes = []         for i in range(max_textboxes):             t = gr.Textbox(f\"127.0.0.1\")             textboxes.append(t)         snd.change(variable_outputs, snd, textboxes)         button = gr.Button(\"\u041d\u0430\u0447\u0430\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443\")         button.click(lambda *s:set_clients(s[:s[-1]]),textboxes+[snd])      with gr.Tab(\"\u0427\u0451\u0440\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a\"):         snd2 = gr.Slider(0, max_textboxes, value=10, step=1, label=\"\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441 \u0430\u0434\u0440\u0435\u0441\u043e\u0432\")         textboxes2 = []         for i in range(max_textboxes):             t = gr.Textbox(f\"127.0.0.1\")             textboxes2.append(t)         snd2.change(variable_outputs, snd2, textboxes2)         button2 = gr.Button(\"\u0411\u0410\u041d\")         button2.click(lambda *s:set_black(s[:s[-1]]),textboxes2+[snd2])        sender = Thread(target=Sender, args=()) sender.start() recv = Thread(target=Receiver, args=()) recv.start()  demo.launch(share=True) <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>Finally<\/h2>\n<p>\u041d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435\u00a0\u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c gradio \u043d\u0435\u00a0\u043f\u043e\u00a0\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e\u00a0\u2014 \u0432\u043e\u0442 \u0438 \u0432\u0435\u0441\u044c \u0432\u044b\u0432\u043e\u0434. <\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430\u00a0\u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435, \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u0432\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u0439\u0442\u0438 \u0447\u0442\u043e\u2011\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0432\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0440\u0430\u0437 \u0443\u0436 \u0434\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u043e\u00a0\u0441\u044e\u0434\u0430. \u041a\u0440\u0438\u0442\u0438\u043a\u0430 \u0438 \u0438\u0434\u0435\u0438 \u043e\u0436\u0438\u0434\u0430\u044e \u0432\u00a0\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u043d\u0430\u00a0\u044d\u0442\u043e\u043c \u0443\u00a0\u043c\u0435\u043d\u044f \u0432\u0441\u0451, \u0432\u0441\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0445 \u0441\u043e\u043a\u0435\u0442\u043e\u0432 \u0438 \u0434\u043e\u0431\u0440\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ea7\/0f8\/aba\/ea70f8aba42c47cbf30795bd42ac153b.png\" width=\"1280\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ea7\/0f8\/aba\/ea70f8aba42c47cbf30795bd42ac153b.png\"\/><\/figure>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \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\/articles\/748626\/\"> https:\/\/habr.com\/ru\/articles\/748626\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0443\u0433\u0430\u0435\u0442 VoIP, discord \u0438 \u0434\u0440. \u0437\u0430 <a href=\"https:\/\/neolurk.org\/wiki\/%D0%A4%D0%B0%D1%82%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9_%D0%BD%D0%B5%D0%B4%D0%BE%D1%81%D1%82%D0%B0%D1%82%D0%BE%D0%BA\" rel=\"noopener noreferrer nofollow\">\u0444\u0430\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a<\/a><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0430\u0440\u0443 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u044d\u0442\u0438 \u0433\u0438\u0442<a href=\"https:\/\/habr.com\/ru\/users\/CodeDroidX\/posts\/\" rel=\"noopener noreferrer nofollow\">\u0445\u0430\u0431\u0440\u044b<\/a> \u0434\u043b\u044f\u00a0\u043c\u0435\u043d\u044f\u00a0\u0431\u044b\u043b\u0438 \u043f\u0442\u0438\u0447\u044c\u0438\u043c \u043f\u0435\u043d\u0438\u0435\u043c, \u0430\u00a0\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043d\u0435\u00a0\u0431\u044b\u043b\u043e \u043d\u0435\u0447\u0435\u0433\u043e\u00a0\u2014 \u043f\u0438\u0441\u0430\u043b \u044f \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0430\u00a0python. \u0421\u0440\u0435\u0434\u0438 \u043d\u0438\u0445\u00a0\u0431\u044b\u043b \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0447\u0430\u0442 \u043d\u0430\u00a0\u0434\u0432\u043e\u0438\u0445 \u0447\u0435\u0440\u0435\u0437 TCP. \u041d\u043e\u00a0\u0432\u043e\u0442 \u044f \u043d\u0430\u0448\u0435\u043b \u0435\u0433\u043e \u0438 \u0437\u0430\u0445\u043e\u0442\u0435\u043b \u0434\u043e\u043f\u0438\u043b\u0438\u0442\u044c. \u041b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u043f\u0438\u043b\u0438\u0442\u044c \u0447\u0442\u043e\u2011\u0442\u043e\u00a0\u2014 \u044d\u0442\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e. <abbr class=\"habraabbr\" title=\"\u0422\u0430\u043c, \u043f\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0431\u0443\u0434\u0435\u0442 \u0442\u0430 \u0435\u0449\u0451 \u0434\u0438\u0447\u044c\" data-title=\"&lt;p>\u0438\u0447\u044c&#187; data-title=&lt;p>\u0422\u0430\u043c, \u043f\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0431\u0443\u0434\u0435\u0442 \u0442\u0430 \u0435\u0449\u0451 \u0434\u0438\u0447\u044c&lt;\/p>&#187; data-abbr=&#187;\u0412\u0441\u0451 \u0447\u0442\u043e \u0432\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0434\u0430\u043b\u0435\u0435&#187;>\u0412\u0441\u0451 \u0447\u0442\u043e\u00a0\u0432\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0434\u0430\u043b\u0435\u0435<\/abbr>\u00a0\u2014 \u0435\u0441\u0442\u044c \u043c\u043e\u0439 \u0433\u0430\u0439\u0434 \u043f\u043e\u00a0\u0438\u0437\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044e \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430 \u0438 \u043d\u0435\u00a0\u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430\u00a0\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. <\/p>\n<hr\/>\n<p>\u0412\u043e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u043e\u0438\u043d\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0441 \u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043c\u043d\u043e\u0439 \u043e\u043f\u044b\u0442\u0430: <\/p>\n<ul>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0435 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0447\u0430\u0441\u0442\u0438: <\/p>\n<ul>\n<li>\n<p>1. <strong>Sender<\/strong> <strong><em>(I)<\/em><\/strong> \u0447\u0438\u0442\u0430\u0435\u0442 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>2. <strong>Receiver<\/strong> <strong><em>(O)<\/em><\/strong> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0432\u0441\u0435 \u0430\u0443\u0434\u0438\u043e\u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0438\u0445 \u0432 \u043d\u0430\u0443\u0448\u043d\u0438\u043a\u0438<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0422\u044b \u043c\u043e\u0436\u0435\u0448\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0433\u043e\u043b\u043e\u0441 \u043a\u043e\u043c\u0443 \u0443\u0433\u043e\u0434\u043d\u043e, \u043d\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0448\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043f\u043e\u0434\u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0447\u0443\u0436\u043e\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e \u043d\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443:<\/p>\n<ul>\n<li>\n<p>\u0422\u044b \u0441\u043b\u044b\u0448\u0438\u0448\u044c \u0432\u0441\u0451, \u0447\u0442\u043e \u0442\u0435\u0431\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 (\u043d\u043e \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0437\u0432\u0443\u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 aka \u0447\u0435\u0440\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a)<\/p>\n<\/li>\n<li>\n<p>\u0422\u044b \u043c\u043e\u0436\u0435\u0448\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0433\u043e\u043b\u043e\u0441 \u043a\u043e\u043c\u0443 \u0443\u0433\u043e\u0434\u043d\u043e, \u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0435\u0448\u044c \u0435\u0433\u043e IP \u0430\u0434\u0440\u0435\u0441.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>TCP \u0438\u043b\u0438 UDP?<\/h2>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u043d\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438:<\/p>\n<ul>\n<li>\n<p><strong>TCP<\/strong>:<\/p>\n<ul>\n<li>\n<p>+ \u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0430\u043a \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0443\u0434\u0438\u043e\u043f\u043e\u0442\u043e\u043a \u043e\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043b\u044e\u0434\u0435\u0439 &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0432\u0441\u0435\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>&#8212; \u0415\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e \u0441\u0435\u0441\u0441\u0438\u0438 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u043c &#8212; \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0438\u0445 \u043c\u043d\u043e\u0433\u043e.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>UDP<\/strong>:<\/p>\n<ul>\n<li>\n<p>+ \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0435\u0441\u0441\u0438\u0438 (\u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0438\u0434\u0430\u0435\u0448\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443)<\/p>\n<\/li>\n<li>\n<p>&#8212; \u041f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u043e\u0442 \u043a\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u043b-\u0432\u0430 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u043e\u043d\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 (\u0432\u0441\u0435 \u0432\u043f\u0435\u0440\u0435\u043c\u0435\u0448\u043a\u0443)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>UDP \u0431\u043e\u043b\u0435\u0435 \u0441\u0445\u043e\u0436 \u0441 \u043c\u043e\u0438\u043c \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u043e\u043c \u0438 \u0443\u0434\u043e\u0431\u0435\u043d \u043a\u043e\u0433\u0434\u0430 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u043c\u043d\u043e\u0433\u043e &#8212; <\/strong>\u0435\u0433\u043e \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041d\u0430\u0434\u0451\u0436\u043d\u044b\u0439 \u043f\u043b\u0430\u043d \u0440\u0430\u0431\u043e\u0442\u044b voicechata \u0447\u0435\u0440\u0435\u0437 UDP<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e, \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043b\u0438\u0434\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/articles\/157287\/\" rel=\"noopener noreferrer nofollow\"><u>venv<\/u><\/a>.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0441\u0440\u0435\u0434\u044b<\/h2>\n<pre><code class=\"bash\">mkdir pycord cd pycord python -m venv venv venv\\scripts\\activate  pip install numpy pip install pyaudio<\/code><\/pre>\n<p>C\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443, \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b\u0438\u043a PyCord.py.<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043f\u043e\u0439\u043b\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u0435\u0440\u044c\u0451\u0437\u043d\u043e, \u043d\u0438\u043a\u0430\u043a\u0438\u0445, api, \u0442\u0435\u0441\u0442\u043e\u0432\u00a0\u2014 \u0444\u0443\u043b\u0441\u0442\u0430\u043a \u0432\u0430\u043c \u043f\u0443\u0445\u043e\u043c.<\/p>\n<\/div>\n<\/details>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0442\u043e, \u0447\u0442\u043e\u00a0\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f.<\/p>\n<pre><code class=\"python\">import pyaudio import socket import numpy as np from threading import Thread<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c IO \u0434\u043b\u044f\u00a0\u0430\u0443\u0434\u0438\u043e\u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<blockquote>\n<p>Pyaudio\u00a0\u2014 \u0441\u0430\u043c\u0430\u044f \u0438\u0437\u044f\u0449\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b. \u0421\u043e\u0437\u0434\u0430\u0435\u0448\u044c \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u00a0\u0431\u0443\u0444\u0435\u0440\u0430\u043c\u0438 \u0432\u0432\u043e\u0434\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434\u0430\u00a0\u2014 \u043f\u0438\u0448\u0435\u0448\u044c, \u0447\u0438\u0442\u0430\u0435\u0448\u044c, \u0432\u0441\u0435 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<\/blockquote>\n<pre><code class=\"python\">CHUNK=2048 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 44100 p = pyaudio.PyAudio()  stream=p.open(format=FORMAT, # \u042d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u043c IO \u0433\u043e\u043b\u043e\u0441\u0430             channels=CHANNELS,             rate=RATE,             input=True,                 output=True,             frames_per_buffer=CHUNK)<\/code><\/pre>\n<h2>Sender (Audio stream -> IPs from list)<\/h2>\n<p>\u041f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434:<\/p>\n<ol>\n<li>\n<p>\u0427\u0438\u0442\u0430\u0435\u043c \u043a\u0443\u0441\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 (\u0434\u0430\u043b\u0435\u0435 <em>\u0447\u0430\u043d\u043a<\/em>) \u0438\u0437\u00a0\u0430\u0443\u0434\u0438\u043e\u043f\u043e\u0442\u043e\u043a\u0430. <\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437\u00a0\u0441\u043f\u0438\u0441\u043a\u0430 clients, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u0438\u0437\u00a0get_clients()\u00a0\u2014 \u043e\u0431\u00a0\u044d\u0442\u043e\u043c \u0434\u0430\u043b\u0435\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0434\u043e\u00a0\u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438 \u043f\u0443\u043d\u043a\u0442\u044b 1\u00a0\u0438 2.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">def Sender():     UDP_PORT = 6006      sock = socket.socket(socket.AF_INET,                         socket.SOCK_DGRAM)     while True:         clients = get_clients() #\u043f\u043e\u043a\u0430 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b         data = stream.read(CHUNK, exception_on_overflow = False)         for addr in clients:             sock.sendto(data, (addr, UDP_PORT))<\/code><\/pre>\n<h2>Receiver (Internet -> Audio stream)<\/h2>\n<p>\u0415\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u043d\u044e\u0430\u043d\u0441, <strong>recvfrom<\/strong> \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f <em>\u0447\u0430\u043d\u043a\u0430<\/em> \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u0434\u0438\u0430\u043b\u043e\u0433\u0435 \u0434\u0432\u0443\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442:<\/p>\n<pre><code class=\"python\">def Receiver():     me = \"127.0.0.1\"     UDP_PORT = 6006      sock = socket.socket(socket.AF_INET,                         socket.SOCK_DGRAM)     sock.bind((me, UDP_PORT))      while True:         num = get_num() #\u043f\u043e\u043a\u0430 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b         for i in range(num):             new = np.frombuffer(sock.recvfrom(CHUNK*10)[0],dtype=np.uint16)             if i == 0:                 data = new.copy()             else:                 data += new         if num != 0:             print(data.shape)             stream.write(data.tobytes())<\/code><\/pre>\n<ul>\n<li>\n<p>\u0447\u0435\u043b\u043e\u0432\u0435\u043a \u21161 \u0437\u0430\u043f\u0438\u0441\u0430\u043b <em>\u0447\u0430\u043d\u043a<\/em> \u0437\u0430 1\/n \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0435\u0433\u043e.<\/p>\n<\/li>\n<li>\n<p>\u0447\u0435\u043b\u043e\u0432\u0435\u043a \u21162 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0435\u0433\u043e \u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 1\/n \u0441\u0435\u043a\u0443\u043d\u0434\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c <em>\u0447\u0430\u043d\u043a\u0438<\/em> \u0441\u0440\u0430\u0437\u0443 \u043e\u0442 \u0434\u0432\u0443\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u043a:<\/p>\n<ul>\n<li>\n<p>\u0447\u0435\u043b\u043e\u0432\u0435\u043a \u21161 \u0437\u0430\u043f\u0438\u0441\u0430\u043b <em>\u0447\u0430\u043d\u043a<\/em> \u21161 \u0437\u0430 1\/n \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0435\u0433\u043e<\/p>\n<\/li>\n<li>\n<p>\u0447\u0435\u043b\u043e\u0432\u0435\u043a \u21162 \u0437\u0430\u043f\u0438\u0441\u0430\u043b <em>\u0447\u0430\u043d\u043a<\/em> \u21162 \u0437\u0430 1\/n \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0435\u0433\u043e<\/p>\n<\/li>\n<li>\n<p>\u0447\u0435\u043b\u043e\u0432\u0435\u043a \u21163 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 2*1\/n \u0441\u0435\u043a\u0443\u043d\u0434\u044b<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u21163 \u0442\u043e\u0440\u043c\u043e\u0437! \u0415\u0433\u043e \u0431\u0443\u0444\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0442\u0451\u0442, \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043c\u0435\u0442\u044c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c <em>\u0447\u0430\u043d\u043a\u0438<\/em> \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0430\u0443\u0434\u0438\u043e\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e: \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432\u044b numpy.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 <em>recvfrom<\/em> \u0442\u0430\u043a: <strong>sock.setblocking(0)<\/strong><\/p>\n<ol>\n<li>\n<p>\u0421\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u043c \u0447\u0430\u043d\u043a\u0438 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u044b\u043f\u0430\u0434\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043e \u043f\u0443\u0441\u0442\u043e\u0442\u0435 \u0431\u0443\u0444\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0437\u0432\u0443\u043a \u0441 \u0447\u0438\u0441\u0442\u043e\u0439 \u0441\u043e\u0432\u0435\u0441\u0442\u044c\u044e \u043f\u0438\u0448\u0435\u043c \u0432 \u0430\u0443\u0434\u0438\u043e\u043f\u043e\u0442\u043e\u043a.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">def Receiver():     me = \"127.0.0.1\"     UDP_PORT = 6006      sock = socket.socket(socket.AF_INET,                         socket.SOCK_DGRAM)     sock.setblocking(0)     sock.bind((me, UDP_PORT))       while True:         c = 0         first = True         while True:             blacklist = get_black() #\u043f\u043e\u043a\u0430 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b             try:                 d,addr = sock.recvfrom(CHUNK*10)                 if addr[0] in blacklist:                     continue                 new = np.frombuffer(d,dtype=np.uint16)                 c += 1                 if first:                     data = new.copy()                     first = False                 else:                     data += new             except:                 break         if not first:             #print(c)             stream.write(data.tobytes())<\/code><\/pre>\n<blockquote>\n<p>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 get_black() \u0434\u043b\u044f \u0427\u0421 \u0438 get_clients() \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u0432\u043e\u0435\u0433\u043e \u0433\u043e\u043b\u043e\u0441\u0430<\/p>\n<\/blockquote>\n<h2>Getters &amp; setters \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f clients, blacklist<\/h2>\n<pre><code class=\"python\">black,clients=[],[]  def set_black(s):     global black     black = s       def get_black():     global black     return black       def set_clients(s):     global clients     clients = s       def get_clients():     global clients     return clients<\/code><\/pre>\n<h2>\u041a\u0430\u043a \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 Reciver \u0438 Sender<\/h2>\n<pre><code class=\"python\">sender = Thread(target=Sender, args=()) sender.start()  recv = Thread(target=Receiver, args=()) recv.start()<\/code><\/pre>\n<p>\u041e\u0431\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u043a\u0430\u043a \u043f\u043e\u0442\u043e\u043a\u0438, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e, \u043a\u0430\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435?<\/p>\n<pre><code class=\"python\">set_black([\"192.168.0.1\"]) # \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0445 \u0430\u0443\u0434\u0438\u043e\u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 2 set_clients([\"127.0.0.1\",\"192.168.0.15\"]) #\u0422\u0435\u043f\u0435\u0440\u044c \u0430\u0443\u0434\u0438\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0431\u0430 \u0430\u0434\u0440\u0435\u0441\u0430<\/code><\/pre>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u0430, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c.<\/p>\n<p>\u041e \u043d\u0451\u043c \u0441\u0435\u0439\u0447\u0430\u0441 \u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c.<\/p>\n<h2>UI<\/h2>\n<p>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0434\u0442\u0438 \u043f\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0439 \u0434\u043e\u0440\u043e\u0436\u043a\u0435, \u0438\u043c\u0435\u043d\u0443\u0435\u043c\u043e\u0439 <strong>Tk<\/strong>, \u0438\u043b\u0438 \u0441\u0445\u043e\u0436\u0435\u0439, \u043d\u043e \u0447\u0443\u0442\u044c \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0439 <strong>Qt<\/strong>, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0434\u0430\u0436\u0435 \u0443\u043f\u043e\u0440\u043e\u0442\u044c\u0441\u044f \u0432 \u0441\u0442\u0438\u043b\u044c \u0441 <strong>DearPyGui<\/strong>, \u043d\u043e \u044d\u0442\u043e \u0432\u0441\u0451 \u0437\u0430\u0435\u0437\u0436\u0435\u043d\u043e \u0438 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0418 \u0442\u0443\u0442 \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b: \u0410 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441?. \u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 &#8212;  <strong>Gradio.<\/strong><\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441 \u0432\u0435\u0431 \u0444\u0440\u043e\u043d\u0442\u043e\u043c, \u0430 \u0437\u0430\u043f\u0430\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0444\u0440\u043e\u043d\u0442\u044d\u043d\u0434\u043e\u043c \u043d\u0430 JS \u0438 \u0434\u0430\u0436\u0435 api \u043d\u0435 \u0443\u043c\u0435\u0441\u0442\u043d\u043e, \u0435\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0435\u0448\u044c \u0447\u0442\u043e-\u0442\u043e \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u043e\u0435 \u0432\u0440\u043e\u0434\u0435 \u043c\u043e\u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430. <\/p>\n<p>\u0417\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0443 \u043c\u0438\u043d\u0443\u0442 \u044f \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0443\u043c\u0430\u043b &#8212; \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439 \u0441\u0435\u0440\u044c\u0451\u0437\u0435\u043d \u043a\u0430\u043a \u043d\u0438\u043a\u043e\u0433\u0434\u0430.<\/p>\n<pre><code class=\"bash\">pip install gradio<\/code><\/pre>\n<pre><code class=\"python\">import gradio as gr<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0421\u043f\u043e\u0439\u043b\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0414\u0443\u043c\u0430\u044e, \u0432\u0441\u0451 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f, <em>\u0442\u0430\u043a \u0435\u0449\u0451 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f PyCord c \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0438\u043b\u0438\u00a0\u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043f\u043e\u00a0\u0432\u0435\u0431 \u043c\u0430\u0439\u043a\u0435 Gradio.<\/em><\/p>\n<\/div>\n<\/details>\n<p>Gradio \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u0442\u044c webui \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e backend\u0430 \u043f\u0440\u044f\u043c\u043e \u0432 \u0435\u0433\u043e \u043a\u043e\u0434\u0435, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430.<\/p>\n<p>WebUI \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u0432\u0435 \u0432\u043a\u043b\u0430\u0434\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c<\/p>\n<ul>\n<li>\n<p>\u0421\u043b\u0430\u0439\u0434\u0435\u0440 \u0432\u044b\u0431\u043e\u0440\u0430 \u043a\u043e\u043b-\u0432\u0430 \u0430\u0434\u0440\u0435\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0435\u0439 \u0432\u0432\u043e\u0434\u0430 \u043f\u043e\u0434 \u044d\u0442\u0438 \u0430\u0434\u0440\u0435\u0441\u0430<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0427\u0451\u0440\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a<\/p>\n<ul>\n<li>\n<p>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0447\u0451\u0440\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">import gradio as gr  def variable_outputs(k):     k = int(k)     return [gr.Textbox.update(visible=True)]*k + [gr.Textbox.update(visible=False)]*(max_textboxes-k)     max_textboxes = 10 with gr.Blocks() as demo:     gr.Markdown(\"PyCord\")      with gr.Tab(\"\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\"):         snd = gr.Slider(0, max_textboxes, value=10, step=1, label=\"\u0410\u0434\u0440\u0435\u0441\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u0435\u0439\")         textboxes = []         for i in range(max_textboxes):             t = gr.Textbox(f\"127.0.0.1\")             textboxes.append(t)         snd.change(variable_outputs, snd, textboxes)         button = gr.Button(\"\u041d\u0430\u0447\u0430\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443\")         button.click(lambda *s:set_clients(s[:s[-1]]),textboxes+[snd])      with gr.Tab(\"\u0427\u0451\u0440\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a\"):         snd2 = gr.Slider(0, max_textboxes, value=10, step=1, label=\"\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441 \u0430\u0434\u0440\u0435\u0441\u043e\u0432\")         textboxes2 = []         for i in range(max_textboxes):             t = gr.Textbox(f\"127.0.0.1\")             textboxes2.append(t)         snd2.change(variable_outputs, snd2, textboxes2)         button2 = gr.Button(\"\u0411\u0410\u041d\")         button2.click(lambda *s:set_black(s[:s[-1]]),textboxes2+[snd2])  <\/code><\/pre>\n<blockquote>\n<p><em>&#171;Gradio<\/em>\u00a0is the fastest way to demo your machine learning model with a friendly web interface so that anyone can use it, anywhere!&#187;  &#8212; \u044f \u0437\u043d\u0430\u043b \u043d\u0430 \u0447\u0442\u043e \u0448\u0451\u043b, \u0447\u0435\u0441\u0442\u043d\u043e<\/p>\n<\/blockquote>\n<figure class=\"full-width\">\n<div><figcaption>Sender<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>Receiver<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0435\u043b\u0430\u0442\u044c Webui \u043a\u00a0\u044d\u0442\u043e\u043c\u0443 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0443\u00a0\u0431\u044b\u043b\u0430 \u0434\u0438\u043a\u043e\u0441\u0442\u044c, \u0437\u043d\u0430\u044e. \u0417\u0430\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u043d\u0430\u00a0\u043f\u043a \u0438\u0437\u00a0\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u043d\u0430\u00a0\u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435!<\/p>\n<figure class=\"float full-width\">\n<div><figcaption>\u043a\u0430\u043a \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c &#8212; \u043d\u043e \u043d\u0435\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e\u00a0\u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u0441\u0451 \u0435\u0449\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u00a0\u041f\u041a, \u0430\u00a0\u044d\u0442\u043e \u00ab\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0430\u00a0\u0432\u044b\u043d\u043e\u0441\u00bb.<\/p>\n<p>\u041d\u0430\u00a0\u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u0430\u0436\u0435 \u043d\u0435\u00a0\u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0443\u0441\u0442\u044b\u043c.<\/p>\n<p>\u041d\u043e\u00a0\u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0451 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f gradio \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u043d\u0430\u00a0\u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435\u00a0\u2014 \u044d\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f.<\/p>\n<p>\u0422\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0448\u044c \u043f\u0430\u043b\u044c\u0446\u0435\u043c \u043c\u0438\u043c\u043e \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430\/\u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u00a0\u044d\u0442\u043e \u0441\u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c&#8230; \u041d\u043e\u00a0\u043e\u0449\u0443\u0449\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0435\u00a0\u0432\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u043e\u0434\u0438\u043d \u044d\u043a\u0440\u0430\u043d \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430, \u0438 \u0442\u044b \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u043f\u0435\u0440\u0435\u043c\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441\u0432\u0430\u0439\u043f\u0430\u043c\u0438.<\/p>\n<h2>\u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e<\/h2>\n<p>\u041d\u043e\u00a0\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u044f \u043f\u043e\u043d\u044f\u043b\u00a0\u2014 \u043f\u043e\u0447\u0435\u043c\u0443 gradio \u043d\u0435\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432\u00a0\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043a\u0435\u0439\u0441\u0430\u0445: \u043e\u043d\u043e \u043e\u0447\u0435\u043d\u044c, \u043e\u0447\u0435\u043d\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0435<\/p>\n<p>\u041e\u043d\u043e \u0434\u043e\u043b\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0444\u0440\u0435\u0439\u043c\u044b, \u043e\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u043b\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442. \u042d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u0439, \u043e\u043d \u043b\u043e\u0432\u0438\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043f\u0440\u0438\u00a0\u0441\u0432\u0430\u0439\u043f\u0430\u0445 \u043d\u0430\u00a0\u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435. \u041f\u0440\u0438\u00a0\u0432\u0441\u0451\u043c \u044d\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0434\u00a0Tk \u043d\u0435\u00a0\u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430 (\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f\u00a0\u0431\u044b\u043b\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u00a0\u043d\u0435\u0433\u043e, \u043d\u043e\u00a0\u043f\u043e\u0442\u043e\u043c \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0447\u0442\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u043e\u0435).<\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u043d\u0430 TCP<\/summary>\n<div class=\"spoiler__content\">\n<p><a href=\"https:\/\/github.com\/CodeDruidX\/PyCord\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/CodeDruidX\/PyCord<\/a><\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">import pyaudio import socket import struct import random import numpy as np  from threading import Thread import gradio as gr   IP = socket.gethostbyname(socket.gethostname())    <\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-350509","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/350509","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=350509"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/350509\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=350509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=350509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=350509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}