{"id":385432,"date":"2024-06-29T06:06:31","date_gmt":"2024-06-29T06:06:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=385432"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=385432","title":{"rendered":"<span>Mediastreamer2. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 Lua-\u043c\u0430\u0448\u0438\u043d\u044b \u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0445<\/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<p>\u042d\u0442\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0433\u043b\u0430\u0432\u043e\u0439 \u043a \u043c\u043e\u0435\u043c\u0443 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443 \u043f\u043e Mediastreamer2. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c:  <a href=\"https:\/\/disk.yandex.ru\/i\/kw2N9Sg36m6BpA\" rel=\"noopener noreferrer nofollow\">\u042f\u043d\u0434\u0435\u043a\u0441-\u0434\u0438\u0441\u043a<\/a>.<\/p>\n<h2>\u0413\u043b\u0430\u0432\u0430 8\u00a0\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 Lua-\u043c\u0430\u0448\u0438\u043d\u044b \u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0445<\/h2>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/509036\/\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u043d\u0435\u0435<\/a> \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u044b, \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0445, \u043f\u043e\u0441\u043b\u0435 \u0441\u0442\u0430\u0440\u0442\u0430, \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u044f \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0435 \u0432 \u043d\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u044b. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440, \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0432 \u043d\u0435\u0433\u043e Lua-\u043c\u0430\u0448\u0438\u043d\u043e\u0439, \u0442\u043e\u0447\u043d\u0435\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c \u0432 \u043d\u0435\u0451 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043c\u0435\u043d\u044f\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p><a href=\"https:\/\/github.com\/chetverovod\/Mediastreamer2_LuaFilter\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0434\u0430\u043d\u043d\u043e\u0439 \u0433\u043b\u0430\u0432\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0441 Github<\/a><\/p>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440, \u0441\u043c. \u0433\u043b\u0430\u0432\u0443\u00a0<a href=\"#chap____________________\" rel=\"noopener noreferrer nofollow\">4<\/a>. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u0431\u043e \u0441\u0438\u0433\u043d\u0430\u043b \u0441 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u044b (<em>sound_card_read<\/em>) \u043b\u0438\u0431\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 DTMF-\u0441\u0438\u0433\u043d\u0430\u043b\u0430 (<em>dtmf_generator<\/em>). \u0414\u0430\u043b\u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430 (<em>lua_filter<\/em>), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c. \u0417\u0430\u0442\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u043d\u0430 \u0440\u0430\u0437\u0432\u0435\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u00a0<em>(Tee),<\/em>\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0434\u0432\u0435 \u043a\u043e\u043f\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0434\u0430\u0435\u0442 \u043d\u0430 \u0434\u0432\u0430 \u0432\u044b\u0445\u043e\u0434\u0430. \u041e\u0434\u0438\u043d \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043d\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 (<em>recorder)<\/em>\u00a0\u0438 \u043d\u0430 \u0437\u0432\u0443\u043a\u043e\u0432\u0443\u044e \u043a\u0430\u0440\u0442\u0443 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f (<em>sound_card_write<\/em>). \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0445 \u043d\u0430 \u0434\u0438\u0441\u043a \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435\u00a0<em>raw<\/em>\u00a0(<em>wav-<\/em>\u0444\u0430\u0439\u043b \u0431\u0435\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430.<\/p>\n<h3>8.1\u00a0\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/h3>\n<p>Lua\u2011\u0444\u0438\u043b\u044c\u0442\u0440 \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0412 \u0444\u0438\u043b\u044c\u0442\u0440\u0435, \u043f\u0440\u0438 \u0435\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Lua-\u043c\u0430\u0448\u0438\u043d\u044b. \u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435\u00a0<a href=\"#fig_dataflow_in_lia_filtr\" rel=\"noopener noreferrer nofollow\">8.1<\/a>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1c6\/60c\/8ae\/1c660c8ae4fcf79a6d3566021d129ab5.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 8.1:\u00a0\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430  \" title=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 8.1:\u00a0\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430  \" width=\"1452\" height=\"204\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1c6\/60c\/8ae\/1c660c8ae4fcf79a6d3566021d129ab5.png\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 8.1:\u00a0\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430  <\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0438\u0439 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0431\u043b\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f Lu\u0430-\u043c\u0430\u0448\u0438\u043d\u0443 \u0447\u0435\u0440\u0435\u0437 \u0435\u0451 \u0441\u0442\u0435\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0432\u0443\u0445 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p><strong>lf_data<\/strong> &#8212; \u0434\u043b\u0438\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0431\u0430\u0439\u0442\u044b \u0431\u043b\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445;<\/p>\n<\/li>\n<li>\n<p><strong>lf_data_len<\/strong> &#8212; \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438\u00a0<em>lf_data<\/em>\u00a0\u0432 \u0431\u0430\u0439\u0442\u0430\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u044d\u0442\u0438 \u0434\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u044b \u043d\u0430 \u0441\u0442\u0435\u043a, \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f Lua-\u043c\u0430\u0448\u0438\u043d\u0435. \u0412 \u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0441\u043e \u0441\u0442\u0435\u043a\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0431\u043b\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u043b\u0438\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043a\u043b\u0430\u0434\u0435\u0442\u0441\u044f \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0438 \u0437\u0430\u0442\u0435\u043c \u043d\u0430 \u0441\u0442\u0435\u043a. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0430\u044f \u043f\u0430\u0440\u0430 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p><strong>lf_data_out<\/strong> &#8212; \u0441\u0442\u0440\u043e\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0431\u0430\u0439\u0442\u044b \u0431\u043b\u043e\u043a\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445;<\/p>\n<\/li>\n<li>\n<p><strong>lf_data_out_len<\/strong> &#8212; \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438\u00a0<em>lf_data_out<\/em>\u00a0\u0432 \u0431\u0430\u0439\u0442\u0430\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0430\u0442\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0441\u0442\u0435\u043a\u0430 \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0431\u043b\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 \u0444\u0438\u043b\u044c\u0442\u0440\u0430.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043c\u0435\u043d\u044f\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043c\u0435\u0434\u0438\u0430\u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442.\u0435. \u043d\u0430 \u043b\u0435\u0442\u0443.<\/p>\n<p>\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0431\u043b\u043e\u043a\u0430 \u0432 Lu\u0430-\u043c\u0430\u0448\u0438\u043d\u0443 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430. \u0411\u043e\u043b\u0435\u0435 \u0438\u0437\u043e\u0449\u0440\u0435\u043d\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0438\u043f\u043e\u0432[<em>User\u2011Defined Types<\/em>](\u00a0<a href=\"https:\/\/www.lua.org\/pil\/28.html)\" rel=\"noopener noreferrer nofollow\">https:\/\/www.lua.org\/pil\/28.html)<\/a>, \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043b\u0435\u0436\u0438\u0442 \u0432\u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u0438.<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u0431\u043b\u043e\u043a \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 16-\u0431\u0438\u0442\u043d\u044b\u0445 \u043e\u0442\u0441\u0447\u0435\u0442\u043e\u0432 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c, \u0442\u043e \u0432 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0441\u0442\u0440\u043e\u043a\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0442\u0441\u0447\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u0432\u0443\u043c\u044f \u0431\u0430\u0439\u0442\u0430\u043c\u0438 \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<h3>8.2\u00a0\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h3>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e Lua-\u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u0443\u0434\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e. \u0412\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e, \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0430\u043a\u0442\u0443 \u0442\u0438\u043a\u0435\u0440\u0430. \u0411\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0447\u0430\u0441\u0442\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043a\u0430\u043a:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430\u00a0\u0441\u043a\u0440\u0438\u043f\u0442\u0430- \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0442\u0430\u043a\u0442\u0430 \u043e\u0442 \u0442\u0438\u043a\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0442\u0435\u043b\u043e\u00a0\u0441\u043a\u0440\u0438\u043f\u0442\u0430- \u044d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0430\u043a\u0442 \u0442\u0438\u043a\u0435\u0440\u0430 (10 \u043c\u0441).<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u044b \u0438 \u0442\u0435\u043b\u0430 \u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u044b LUA_FILTER_SET_PREAMBLE \u0438 LUA_FILTER_RUN \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<h4>8.2.1\u00a0\u041f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h4>\n<p>\u042d\u0442\u043e \u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 Lua-\u043a\u043e\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0442\u0435\u043b\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0430) \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u0435\u0440\u0432\u044b\u043c \u0442\u0430\u043a\u0442\u043e\u043c \u0442\u0438\u043a\u0435\u0440\u0430, \u0442\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0451 \u043a\u043e\u0434 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0442\u0438\u043a\u0435\u0440. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434 LUA_FILTER_SET_PREAMBLE, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 -\u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0438 \u0432\u0442\u043e\u0440\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u044b. \u041f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0443 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\/\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0444\u0438\u043b\u044c\u0442\u0440 \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0438 \u0432 \u043b\u044e\u0431\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u041f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u044b \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0435\u0451 \u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c \u0442\u0430\u043a\u0442\u0435.<\/p>\n<h4>8.2.2\u00a0\u0422\u0435\u043b\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h4>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u044b, \u044d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0430\u043a\u0442 \u0442\u0438\u043a\u0435\u0440\u0430 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u0430\u0436\u0434\u044b\u0435 10\u043c\u0441). \u0414\u0430\u043d\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\/\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0444\u0438\u043b\u044c\u0442\u0440 \u0432 \u043b\u044e\u0431\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u043c\u0435\u0442\u043e\u0434 LUA_FILTER_RUN \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0435.<\/p>\n<h4>8.2.3\u00a0\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h4>\n<p>\u0412 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c (\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u043f\u0430\u0443\u0437\u0443) \u043c\u0435\u0442\u043e\u0434\u043e\u043c LUA_FILTER_STOP. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0431\u043b\u043e\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 \u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u043c\u0438\u043d\u0443\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c. \u0412\u043e\u0437\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0432 \u043c\u0435\u0442\u043e\u0434 LUA_FILTER_RUN. \u041f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0432 \u0432\u043c\u0435\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0442\u0435\u043a\u0441\u0442 \u0442\u0435\u043b\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043b\u0438\u0431\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u0442\u0435\u043a\u0441\u0442.<\/p>\n<h4>8.2.4\u00a0\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043a\u0440\u0438\u043f\u0442 \u043c\u043e\u0433 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0441\u0442\u0440\u043e\u043a\u0443, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c<em>\u00a0get_sample()<\/em>\u00a0\u0438\u00a0<em>append_sample()<\/em>. \u041f\u0435\u0440\u0432\u0430\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u043e\u0442\u0441\u0447\u0435\u0442\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0434\u043b\u0438\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043e\u0442\u0441\u0447\u0435\u0442. \u0418\u0445 \u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435\u00a0<a href=\"#lis_access_data_funcs\" rel=\"noopener noreferrer nofollow\">8.1<\/a>.<\/p>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8.1:\u00a0\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c<\/p>\n<pre><code class=\"lua\">-- funcs.lua  -- \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u043e\u0434\u0438\u043d 16-\u0431\u0438\u0442\u043d\u044b\u0439 \u043e\u0442\u0441\u0447\u0435\u0442. function get_sample(s, sample_index) local byte_index = 2*sample_index - 1 local L = string.byte(s, byte_index) local H = string.byte(s, byte_index + 1) local v = 256 * H + L if (H >= 128) then v = - ((~(v - 1)) &amp; 65535) end return v end  -- \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u043e\u0434\u0438\u043d 16-\u0431\u0438\u0442\u043d\u044b\u0439 \u043e\u0442\u0441\u0447\u0435\u0442. function append_sample(s, sample_value) local v = math.floor(sample_value + 0.5) if v &lt; 0 then v = - v v = ((~v) + 1) &amp; 65535 end local H = v \/\/ 256 local L = v - H * 256 return  s .. string.char(L, H) end <\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<em>get_sample()<\/em>\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043e\u0442\u0441\u0447\u0435\u0442\u0430\u043c \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u043c\u0441\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0435. \u041e\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0434\u0438\u043d 16\u2011\u0431\u0438\u0442\u043d\u044b\u0439 \u043e\u0442\u0441\u0447\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438\u00a0<em>s<\/em>. \u041f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u043e\u0442\u0441\u0447\u0435\u0442\u0430\u00a0<em>sample_index()\u00a0<\/em>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u044b 2 \u0431\u0430\u0439\u0442\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043d \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f. \u0414\u0430\u043b\u0435\u0435 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0431\u0430\u0439\u0442\u043e\u0432 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f 16-\u0442\u0438 \u0431\u0438\u0442\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443, \u043e\u0442\u0441\u0447\u0435\u0442 \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c, \u0442\u043e \u044d\u0442\u0438 \u0431\u0430\u0439\u0442\u044b \u0445\u0440\u0430\u043d\u044f\u0442 \u0447\u0438\u0441\u043b\u043e \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0447\u0438\u0441\u043b\u043e \u043a \u043e\u0431\u044b\u0447\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 15-\u0433\u043e \u0431\u0438\u0442\u0430 \u0447\u0438\u0441\u043b\u0430. \u0415\u0441\u043b\u0438 \u043e\u043d \u0440\u0430\u0432\u0435\u043d 0 \u0442\u043e \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e. \u0415\u0441\u043b\u0438 \u0431\u0438\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u0442\u043e \u0447\u0438\u0441\u043b\u043e \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435. \u0422\u043e\u0433\u0434\u0430 \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0437 \u0447\u0438\u0441\u043b\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u044e \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u0438\u0442\u0430 \u0438 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u043d\u0430 \u20131.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<em>append_sample()\u00a0<\/em>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041e\u043d\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043a \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u0441\u0432\u043e\u0435\u043c\u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0443 (\u0441\u0442\u0440\u043e\u043a\u0435) \u0434\u0432\u0430 \u0431\u0430\u0439\u0442\u0430, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 (\u043e\u0442\u0441\u0447\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u043b\u0430) \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<p>\u0424\u0430\u0439\u043b \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f\u00a0<em>funcs.lua\u00a0<\/em>\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u0434 \u0444\u0438\u043b\u044c\u0442\u0440\u0430.<\/p>\n<h4>8.2.5\u00a0\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h4>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043a\u0432\u043e\u0437\u044c \u0441\u0435\u0431\u044f \u043d\u0435 \u043c\u0435\u043d\u044f\u044f \u0438\u0445.<\/p>\n<p>\u041f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435\u00a0<a href=\"#lis_script_preambula\" rel=\"noopener noreferrer nofollow\">8.2<\/a>:<\/p>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8.2:\u00a0\u041f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/p>\n<pre><code class=\"lua\">-- preambula2.lua -- \u042d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u043a\u0430\u043a \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430. -- \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c. require \"funcs\" preambula_status = 0 body_status = 0 -- \u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430. local greetings = 'Hello world from preambula!\\n' -- \u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435. print(greetings) return preambula_status <\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0435 \u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0441\u0438\u0433\u043d\u0430\u043b\u0430 (<em>funcs.lua<\/em>).<\/p>\n<p>\u0422\u0435\u043b\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435\u00a0<a href=\"#lis_script_body\" rel=\"noopener noreferrer nofollow\">8.3<\/a>:<\/p>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8.3:\u00a0\u0422\u0435\u043b\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/p>\n<pre><code class=\"lua\">-- body2.lua -- \u042d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0432 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u043a\u0430\u043a \u0442\u0435\u043b\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430. -- \u041f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. lf_data_out =\"\" if lf_data_len == nil then print(\"Bad lf_data_len.\\n\") end for i = 1, lf_data_len\/2 do s = get_sample(lf_data, i) lf_data_out = append_sample(lf_data_out, s) end lf_data_out_len = string.len(lf_data_out) return body_status <\/code><\/pre>\n<p>\u0412 \u0442\u0435\u043b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0433\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0441\u0447\u0435\u0442\u044b \u0438\u0437 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u0435\u0436\u0434\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438\u00a0<em>get_sample()<\/em>\u00a0\u0438\u00a0<em>append_sample()\u00a0<\/em>\u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0441\u0447\u0435\u0442\u043e\u0432. \u0412\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0444\u0438\u043b\u044c\u0442\u0440 \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0442\u0441\u0447\u0435\u0442\u044b, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c\u0438 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0443\u0434\u043e\u0431\u043d\u043e \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0444\u0430\u0439\u043b\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445: \u0442\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430: \u0438 \u0432\u0430\u043c \u0441\u0442\u0430\u043d\u0435\u0442 \u044f\u0441\u043d\u043e, \u043a\u0430\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443.<\/p>\n<pre><code class=\"lua\">-- preambula2.lua<\/code><\/pre>\n<pre><code> Filter &lt;LUA_FILTER> Lua error. Lua error description:&lt;[string \"-- preambula2.lua ...\"]:12: attempt to perform arithmetic on a nil value>.<\/code><\/pre>\n<h3>8.3\u00a0\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/h3>\n<p>\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8.4: \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/p>\n<pre><code class=\"cpp\">#ifndef lua_filter_h #define lua_filter_h \/* \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u043c\u0435\u0434\u0438\u0430\u0441\u0442\u0440\u0438\u043c\u0435\u0440\u0430. *\/ #include &lt;mediastreamer2\/msfilter.h> \/* \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 Lua. *\/ #include &lt;lua5.3\/lua.h> #include &lt;lua5.3\/lauxlib.h> #include &lt;lua5.3\/lualib.h> \/* \u0417\u0430\u0434\u0430\u0435\u043c \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043d\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430. \u042d\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u043d\u0438 \u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432.  \u0412 \u043c\u0435\u0434\u0438\u0430\u0441\u0442\u0440\u0438\u043c\u0435\u0440\u0435  \u0432 \u0444\u0430\u0439\u043b\u0435 allfilters.h \u0435\u0441\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 enum MSFilterId. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u0430\u043d\u044f\u0442\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b. \u041d\u043e \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 id \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0437\u0430\u0432\u0435\u0434\u043e\u043c\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435: 4001.   \u0411\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043d\u043e\u0432\u044b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b, \u043d\u0435 \u0441\u043a\u043e\u0440\u043e \u0434\u043e\u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430. *\/ #define LUA_FILTER_ID 4001 \/* \u0418\u043c\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 \u0431\u043b\u043e\u043a \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. *\/ #define LF_DATA_CONST       \"lf_data\" \/* \u0418\u043c\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u043b\u043e\u043a\u0430 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.*\/ #define LF_DATA_LEN_CONST   \"lf_data_len\" \/* \u0418\u043c\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 \u0431\u043b\u043e\u043a \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.*\/ #define LF_DATA_OUT_CONST   \"lf_data_out\" \/* \u0418\u043c\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u043b\u043e\u043a\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.*\/ #define LF_DATA_OUT_LEN_CONST \"lf_data_out_len\" \/* \u0424\u043b\u0430\u0433 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u0445\u043e\u0434\u043d\u0430\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043f\u0443\u0441\u0442\u0430. *\/ #define LF_INPUT_EMPTY_CONST \"input_empty\" \/* \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u0430. *\/ #define LF_DATA             LF_DATA_CONST #define LF_DATA_LEN         LF_DATA_LEN_CONST #define LF_DATA_OUT         LF_DATA_OUT_CONST #define LF_DATA_OUT_LEN     LF_DATA_OUT_LEN_CONST #define LF_INPUT_EMPTY      LF_INPUT_EMPTY_CONST \/* \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430. \u0412\u0442\u043e\u0440\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u043c\u0435\u0442\u043e\u0434\u0430, \u0447\u0438\u0441\u043b\u043e \u043e\u0442 0.  \u0422\u0440\u0435\u0442\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u044d\u0442\u043e \u0442\u0438\u043f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043c\u0435\u0442\u043e\u0434\u0430, \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u0443 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435. *\/ #define LUA_FILTER_RUN      MS_FILTER_METHOD(LUA_FILTER_ID,0,char) #define LUA_FILTER_STOP         MS_FILTER_METHOD(LUA_FILTER_ID,1,int) #define LUA_FILTER_SET_PREAMBLE MS_FILTER_METHOD(LUA_FILTER_ID,2,char) \/* \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432. *\/ extern MSFilterDesc lua_filter_desc; #endif \/* lua_filter_h *\/<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 Lua\u2011\u043c\u0430\u0448\u0438\u043d\u044b \u0438 \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0442\u0440\u0438 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0445 \u0432\u044b\u0448\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430:<\/p>\n<ul>\n<li>\n<p>LUA_FILTER_RUN;<\/p>\n<\/li>\n<li>\n<p>LUA_FILTER_STOP;<\/p>\n<\/li>\n<li>\n<p>LUA_FILTER_SET_PREAMBLE.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0432\u0430\u0436\u043d\u043e\u0439 \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u0438, \u0442.\u0435. \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u0435\u0442\u043e\u0434\u0430\u00a0<em>control_process()\u00a0<\/em>(\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438\u00a0A). \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a Lua-\u043c\u0430\u0448\u0438\u043d\u044b \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0430\u043a\u0442\u0443 \u0442\u0438\u043a\u0435\u0440\u0430. \u0415\u0433\u043e \u0442\u0435\u043a\u0441\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435\u00a0<a href=\"#lis_method_control_process__\" rel=\"noopener noreferrer nofollow\">8.5<\/a>.<\/p>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8.5:\u00a0\u041c\u0435\u0442\u043e\u0434 control_process()<\/p>\n<pre><code class=\"cpp\">static void control_process(MSFilter *f) { ControlData *d = (ControlData *)f->data; mblk_t *im; mblk_t *out_im = NULL; int err = 0; int i;  if ((!d->stopped) &amp;&amp; (!d->preabmle_was_run)) { run_preambula(f); }  while ((im = ms_queue_get(f->inputs[0])) != NULL) { unsigned int disabled_out = 0; if ((!d->stopped) &amp;&amp; (d->script_code) &amp;&amp; (d->preabmle_was_run)) {   bool_t input_empty = ms_queue_empty(f->inputs[0]);   lua_pushinteger(d->L, (lua_Integer)input_empty);   lua_setglobal(d->L, LF_INPUT_EMPTY);          \/* \u041a\u043b\u0430\u0434\u0435\u043c \u0431\u043b\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e \u0432\u0445\u043e\u0434\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043d\u0430 \u0441\u0442\u0435\u043a Lua-\u043c\u0430\u0448\u0438\u043d\u044b. *\/   size_t sz = 2 * (size_t)msgdsize(im); \/* \u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u043b\u043e\u043a\u0430 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445.*\/   lua_pushinteger(d->L, (lua_Integer)sz);   lua_setglobal(d->L, LF_DATA_LEN);          lua_pushlstring(d->L, (const char *)im->b_rptr, sz);   lua_setglobal(d->L, LF_DATA);    \/* \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0441\u043e \u0441\u0442\u0435\u043a\u0430 \u0432\u0441\u0435, \u0447\u0442\u043e \u0442\u0430\u043c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c. *\/   int values_on_stack;   values_on_stack = lua_gettop(d->L);   lua_pop(d->L, values_on_stack);    \/* \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0442\u0435\u043b\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430. *\/   err = luaL_dostring(d->L, d->script_code);    \/* \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. *\/   if (!err)   {   int script_body_status = lua_tointeger(d->L, lua_gettop(d->L));   if (script_body_status &lt; 0)   {   printf(\"\\nFilter &lt;%s> bad script_body_status: %i.\\n\", f->desc->name,  script_body_status);   }    \/* \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u043d \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f. *\/   lua_getglobal(d->L, LF_DATA_OUT_LEN);   size_t real_size = 0;   char type_on_top = lua_type(d->L, lua_gettop(d->L));    \/\/ printf(\"Type on top: %i\\n\", type_on_top);   if (type_on_top == LUA_TNUMBER)   {   real_size =   (size_t)lua_tointeger(d->L, lua_gettop(d->L));   \/\/ printf(\"------- size from lua %lu\\n\", real_size);   }   lua_pop(d->L, 1);    \/* \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0434\u043b\u0438\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430    \u0434\u0430\u043d\u043d\u044b\u0445. \u0418 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0434\u0430\u043b\u0435\u0435. *\/   lua_getglobal(d->L, LF_DATA_OUT);   size_t str_len = 0;   if (lua_type(d->L, lua_gettop(d->L)) == LUA_TSTRING)   {   const char *msg_body = lua_tolstring(d->L, -1, &amp;str_len);   if (msg_body &amp;&amp; str_len)   {   size_t msg_len = real_size \/ 2;    out_im = allocb((int)msg_len, 0);   memcpy(out_im->b_wptr, msg_body, msg_len);   out_im->b_wptr = out_im->b_wptr + msg_len;   }   }   lua_pop(d->L, 1);    \/* \u0412\u044b\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435, \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430 \u0441\u0442\u0435\u043a\u0435. *\/   values_on_stack = lua_gettop(d->L);   lua_pop(d->L, values_on_stack);   }   else   {   printf(\"\\nFilter &lt;%s> Lua error.\\n\", f->desc->name);   const char *answer = lua_tostring(d->L, lua_gettop(d->L));   if (answer)   {   printf(\"Lua error description:&lt;%s>.\\n\", answer);   }   } } mblk_t *p = im; if (out_im) p = out_im;  for (i = 0; i &lt; f->desc->noutputs; i++) {   if ((!disabled_out) &amp;&amp; (f->outputs[i] != NULL))   if (p)   ms_queue_put(f->outputs[i], dupmsg(p)); }  freemsg(out_im); freemsg(im); } }<\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u0435\u0442\u043e\u0434\u00a0<em>control_process()<\/em>\u00a0\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u043e\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0435\u0441\u043b\u0438 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e LF_INPUT_EMPTY, \u0447\u0442\u043e\u0431\u044b, \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u043c\u043e\u0433 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u043a\u043e\u0433\u0434\u0430 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442. \u0417\u0430\u0442\u0435\u043c, \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0435\u0441\u0442\u044c, \u043a\u0430\u043a \u0438 \u0432 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 \u043e\u043d \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0438\u0445 \u0432\u044b\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c. \u041a\u0430\u0436\u0434\u044b\u0439 \u0431\u043b\u043e\u043a, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 160 \u043e\u0442\u0441\u0447\u0435\u0442\u043e\u0432 \u0438\u043b\u0438 320 \u0431\u0430\u0439\u0442, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u043b\u043e\u043a\u0430. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0435\u043a Lua-\u043c\u0430\u0448\u0438\u043d\u044b, \u0430 \u0438\u0437 \u043d\u0435\u0433\u043e \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e Lua\u2011\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e\u00a0<em>lf_data_len<\/em>\u00a0(\u0446\u0435\u043e\u0435). \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434 \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u0442\u0443\u0434\u0430 \u0436\u0435 \u043d\u0430 \u0441\u0442\u0435\u043a \u0441\u0430\u043c \u0431\u043b\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0438\u0437 \u043d\u0435\u0433\u043e \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e\u00a0<em>lf_data<\/em>\u00a0(\u0434\u043b\u0438\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430). \u0414\u0430\u043b\u0435\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f Lua-\u043c\u0430\u0448\u0438\u043d\u0435, \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code>luaL_dostring(d->L, d->script_code)<\/code><\/pre>\n<p>\u043c\u0430\u0448\u0438\u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0441\u043a\u0440\u0438\u043f\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d, \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b Lua\u2011\u043c\u0430\u0448\u0438\u043d\u044b \u0432 \u043c\u0435\u0442\u043e\u0434.<\/p>\n<h3>8.4\u00a0\u0422\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d Lua\u2011\u0444\u0438\u043b\u044c\u0442\u0440, \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043d\u0435\u0433\u043e. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0441\u0445\u0435\u043c\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435\u00a0<a href=\"#fig_Lua_filter_testbench\" rel=\"noopener noreferrer nofollow\">8.2<\/a>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cb2\/942\/c49\/cb2942c495640d7d180a7307594f0354.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 8.2:\u00a0\u0421\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430\" title=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 8.2:\u00a0\u0421\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430\" width=\"1004\" height=\"131\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cb2\/942\/c49\/cb2942c495640d7d180a7307594f0354.png\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 8.2:\u00a0\u0421\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u00a0\u0420\u0438\u0441\u0443\u043d\u043e\u043a 8.2:\u00a0\u0421\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c. \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0445\u0435\u043c\u0430 \u0438\u0437 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432, \u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0442\u0430\u043a\u0442\u043e\u0432\u044b\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432, \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432. \u041e\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u00a0<em>init()<\/em>. \u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c, \u043d\u043e \u043f\u043e\u043c\u0438\u043c\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u0432\u00a0<em>init()<\/em>\u00a0\u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c Lua-\u043a\u043e\u0434 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u044b, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Lua-\u043c\u0430\u0448\u0438\u043d\u044b. \u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0439 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u044e\u0447\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 &#171;<em>scp<\/em>&#187; \u0414\u0440\u0443\u0433\u0430\u044f \u0447\u0430\u0441\u0442\u044c, \u0442\u0435\u043b\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u043a\u043b\u044e\u0447\u043e\u043c &#171;<em>scb<\/em>&#171;. \u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043b\u044e\u0447\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435\u00a0<a href=\"#lis_test_app_keys\" rel=\"noopener noreferrer nofollow\">8.6<\/a>.<\/p>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8.6:\u00a0\u041a\u043b\u044e\u0447\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<pre><code>--help      List of options. --version   Version of application. --scp       Full name of containing preambula of Lua-script file. --scb       Full name of containing body of Lua-script file. --gen       Set generator's frequency, Hz. --rec       Make recording to a file 'record.wav'. <\/code><\/pre>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438\u00a0\u0411. \u0420\u0430\u043d\u0435\u0435, \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0433\u043b\u0430\u0432\u044b, \u0431\u044b\u043b\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0430 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043f\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435<\/p>\n<pre><code>README.md<\/code><\/pre>\n<p>\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>$ .\/lua_filter_demo --scb ..\/scripts\/body2.lua  --scp ..\/scripts\/preambula2.lua --gen 600   <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u043d\u0430\u0443\u0448\u043d\u0438\u043a\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 10 \u0441\u0435\u043a\u0443\u043d\u0434 \u0442\u043e\u043d 600 \u0413\u0446. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0438\u0433\u043d\u0430\u043b \u043f\u0440\u043e\u0448\u0435\u043b \u0447\u0435\u0440\u0435\u0437 \u0444\u0438\u043b\u044c\u0442\u0440.<\/p>\n<h3>8.5\u00a0\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/h3>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 5000\u0433\u043e \u043e\u0442\u0441\u0447\u0435\u0442\u0430 ( \u0442.\u0435. 5\/8 \u0441\u0435\u043a\u0443\u043d\u0434\u044b), \u0431\u0443\u0434\u0435\u0442 \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u043d\u0430 \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u043d\u0438\u0437\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b (\u0442.\u0435. \u043f\u0440\u043e\u043c\u043e\u0434\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u043f\u043e \u0430\u043c\u043f\u043b\u0438\u0442\u0443\u0434\u0435) \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 2 \u0441\u0435\u043a\u0443\u043d\u0434. \u0417\u0430\u0442\u0435\u043c \u0441\u0438\u0433\u043d\u0430\u043b \u0441\u043d\u043e\u0432\u0430 \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0435\u043c\u043e\u0434\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c.<\/p>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8.7: \u041f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430-\u043c\u043e\u0434\u0443\u043b\u044f\u0442\u043e\u0440\u0430<\/p>\n<pre><code class=\"lua\">-- preambula3.lua -- \u042d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u043a\u0430\u043a \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430. -- \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c. require \"funcs\" preambula_status = 0 body_status = 0 -- \u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430. -- \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432. samples_count = 0 sampling_rate = 8000 low_frequency = 2 -- \u041c\u043e\u0434\u0443\u043b\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430. phase_step = 2 * math.pi \/ sampling_rate * low_frequency return preambula_status <\/code><\/pre>\n<p>\u041c\u043e\u0434\u0443\u043b\u044f\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8.8: \u0422\u0435\u043b\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430-\u043c\u043e\u0434\u0443\u043b\u044f\u0442\u043e\u0440\u0430<\/p>\n<pre><code class=\"lua\">-- body3.lua -- \u042d\u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0432 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u043a\u0430\u043a \u0442\u0435\u043b\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430. -- \u0421\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044f\u0446\u0438\u044e \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430. lf_data_out =\"\" if lf_data_len == nil then print(\"Bad lf_data_len.\\n\") end for i = 1, lf_data_len\/2 do s = get_sample(lf_data, i) if (samples_count > 5000)  and (samples_count &lt; 21000) then output_s = s * math.sin( phase_step * samples_count ) else output_s = s end samples_count = samples_count + 1 lf_data_out = append_sample(lf_data_out, output_s) end lf_data_out_len = string.len(lf_data_out) return body_status <\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043d\u043e\u0432\u044b\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c:<\/p>\n<pre><code>$ .\/lua_filter_demo --scb ..\/scripts\/body3.lua  --scp ..\/scripts\/preambula3.lua --gen 1200 --rec   <\/code><\/pre>\n<p>\u0447\u0435\u0440\u0435\u0437 5 \u0441\u0435\u043a\u0443\u043d\u0434, \u0447\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0436\u043c\u0435\u043c \u043d\u0430 \u043a\u043b\u0430\u0432\u0438\u0448\u0443 \u00ab<em>Enter<\/em>\u00bb. \u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0444\u0430\u0439\u043b, \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u043c\u044b \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435 \u0432\u00a0<a href=\"#how_to_play_raw\" rel=\"noopener noreferrer nofollow\">3.8<\/a>:<\/p>\n<pre><code>$ aplay -t raw --format s16_be --channels 1 .\/record.raw<\/code><\/pre>\n<p>\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u0432\u00a0<em>wav<\/em>\u2011\u0444\u043e\u0440\u043c\u0430\u0442:<\/p>\n<pre><code>$ sox -t raw -r 8000 -b 16 -c 1 -L -e signed-integer .\/record.raw  .\/recording.wav  <\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b \u0432\u00a0<em>gnuplot<\/em>, \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a \u0444\u0430\u0439\u043b\u0443 \u0441 \u0434\u0432\u0443\u043c\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0442\u0430 \u0436\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u00a0<em>sox  <\/em>\u0432 \u043f\u0430\u0440\u0435<em> grep<\/em>:<\/p>\n<pre><code>$ sox .\/recording.wav  -r 8000 recording.dat &amp;&amp; grep -v \u00ab^;\u00bb recording.dat > clean_recording.dat<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0444\u0430\u0439\u043b\u00a0<em>recording.wav<\/em>\u00a0\u0443\u0442\u0438\u043b\u0438\u0442\u0435\u00a0gnuplot:<\/p>\n<pre><code>$ gnuplot -e \"set terminal png; set output 'recording.png'; plot 'clean_recording.dat' using 1:2 with lines\"<\/code><\/pre>\n<p>\u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435\u00a0<a href=\"#fig_lua_filter_result\" rel=\"noopener noreferrer nofollow\">8.3<\/a>\u00a0\u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/033\/827\/ad1\/033827ad1b10652b4e4ebed0d4fbeb5b.png\" alt=\"\u00a0\u0420\u0438\u0441\u0443\u043d\u043e\u043a 8.3:\u00a0\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430\" title=\"\u00a0\u0420\u0438\u0441\u0443\u043d\u043e\u043a 8.3:\u00a0\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430\" width=\"640\" height=\"480\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/033\/827\/ad1\/033827ad1b10652b4e4ebed0d4fbeb5b.png\"\/><\/p>\n<div><figcaption>\u00a0\u0420\u0438\u0441\u0443\u043d\u043e\u043a 8.3:\u00a0\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043e\u0433\u0438\u0431\u0430\u044e\u0449\u0443\u044e \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430, \u043f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0444\u0438\u043b\u044c\u0442\u0440. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 5\/8 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0430\u043c\u043f\u043b\u0438\u0442\u0443\u0434\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u043e\u0439, \u0437\u0430\u0442\u0435\u043c \u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0430\u0441\u044c \u0432\u0435\u0442\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u0446\u0438\u0438: <\/p>\n<pre><code>output_s = s * math.sin( phase_step * samples_count)<\/code><\/pre>\n<p>\u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u043c\u043e\u0434\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u043b \u043c\u043e\u0434\u0443\u043b\u044f\u0446\u0438\u044e \u0438 \u0441\u0438\u0433\u043d\u0430\u043b \u0441\u0442\u0430\u043b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 \u0431\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044f\u0446\u0438\u0438.<\/p>\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\/728188\/\"> https:\/\/habr.com\/ru\/articles\/728188\/<\/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<p>\u042d\u0442\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0433\u043b\u0430\u0432\u043e\u0439 \u043a \u043c\u043e\u0435\u043c\u0443 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443 \u043f\u043e Mediastreamer2. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c:  <a href=\"https:\/\/disk.yandex.ru\/i\/kw2N9Sg36m6BpA\" rel=\"noopener noreferrer nofollow\">\u042f\u043d\u0434\u0435\u043a\u0441-\u0434\u0438\u0441\u043a<\/a>.<\/p>\n<h2>\u0413\u043b\u0430\u0432\u0430 8\u00a0\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 Lua-\u043c\u0430\u0448\u0438\u043d\u044b \u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0445<\/h2>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/509036\/\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u043d\u0435\u0435<\/a> \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u044b, \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0445, \u043f\u043e\u0441\u043b\u0435 \u0441\u0442\u0430\u0440\u0442\u0430, \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u044f \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0435 \u0432 \u043d\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u044b. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440, \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0432 \u043d\u0435\u0433\u043e Lua-\u043c\u0430\u0448\u0438\u043d\u043e\u0439, \u0442\u043e\u0447\u043d\u0435\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c \u0432 \u043d\u0435\u0451 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043c\u0435\u043d\u044f\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p><a href=\"https:\/\/github.com\/chetverovod\/Mediastreamer2_LuaFilter\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0434\u0430\u043d\u043d\u043e\u0439 \u0433\u043b\u0430\u0432\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0441 Github<\/a><\/p>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440, \u0441\u043c. \u0433\u043b\u0430\u0432\u0443\u00a0<a href=\"#chap____________________\" rel=\"noopener noreferrer nofollow\">4<\/a>. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u0431\u043e \u0441\u0438\u0433\u043d\u0430\u043b \u0441 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u044b (<em>sound_card_read<\/em>) \u043b\u0438\u0431\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 DTMF-\u0441\u0438\u0433\u043d\u0430\u043b\u0430 (<em>dtmf_generator<\/em>). \u0414\u0430\u043b\u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430 (<em>lua_filter<\/em>), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c. \u0417\u0430\u0442\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u043d\u0430 \u0440\u0430\u0437\u0432\u0435\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u00a0<em>(Tee),<\/em>\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0434\u0432\u0435 \u043a\u043e\u043f\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0434\u0430\u0435\u0442 \u043d\u0430 \u0434\u0432\u0430 \u0432\u044b\u0445\u043e\u0434\u0430. \u041e\u0434\u0438\u043d \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043d\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 (<em>recorder)<\/em>\u00a0\u0438 \u043d\u0430 \u0437\u0432\u0443\u043a\u043e\u0432\u0443\u044e \u043a\u0430\u0440\u0442\u0443 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f (<em>sound_card_write<\/em>). \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0445 \u043d\u0430 \u0434\u0438\u0441\u043a \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435\u00a0<em>raw<\/em>\u00a0(<em>wav-<\/em>\u0444\u0430\u0439\u043b \u0431\u0435\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430.<\/p>\n<h3>8.1\u00a0\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/h3>\n<p>Lua\u2011\u0444\u0438\u043b\u044c\u0442\u0440 \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0412 \u0444\u0438\u043b\u044c\u0442\u0440\u0435, \u043f\u0440\u0438 \u0435\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Lua-\u043c\u0430\u0448\u0438\u043d\u044b. \u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435\u00a0<a href=\"#fig_dataflow_in_lia_filtr\" rel=\"noopener noreferrer nofollow\">8.1<\/a>.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 8.1:\u00a0\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430  <\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0438\u0439 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0431\u043b\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f Lu\u0430-\u043c\u0430\u0448\u0438\u043d\u0443 \u0447\u0435\u0440\u0435\u0437 \u0435\u0451 \u0441\u0442\u0435\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0432\u0443\u0445 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p><strong>lf_data<\/strong> &#8212; \u0434\u043b\u0438\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0431\u0430\u0439\u0442\u044b \u0431\u043b\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445;<\/p>\n<\/li>\n<li>\n<p><strong>lf_data_len<\/strong> &#8212; \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438\u00a0<em>lf_data<\/em>\u00a0\u0432 \u0431\u0430\u0439\u0442\u0430\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u044d\u0442\u0438 \u0434\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u044b \u043d\u0430 \u0441\u0442\u0435\u043a, \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f Lua-\u043c\u0430\u0448\u0438\u043d\u0435. \u0412 \u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0441\u043e \u0441\u0442\u0435\u043a\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0431\u043b\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u043b\u0438\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043a\u043b\u0430\u0434\u0435\u0442\u0441\u044f \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0438 \u0437\u0430\u0442\u0435\u043c \u043d\u0430 \u0441\u0442\u0435\u043a. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0430\u044f \u043f\u0430\u0440\u0430 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p><strong>lf_data_out<\/strong> &#8212; \u0441\u0442\u0440\u043e\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0431\u0430\u0439\u0442\u044b \u0431\u043b\u043e\u043a\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445;<\/p>\n<\/li>\n<li>\n<p><strong>lf_data_out_len<\/strong> &#8212; \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438\u00a0<em>lf_data_out<\/em>\u00a0\u0432 \u0431\u0430\u0439\u0442\u0430\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0430\u0442\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0441\u0442\u0435\u043a\u0430 \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0431\u043b\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 \u0444\u0438\u043b\u044c\u0442\u0440\u0430.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043c\u0435\u043d\u044f\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043c\u0435\u0434\u0438\u0430\u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442.\u0435. \u043d\u0430 \u043b\u0435\u0442\u0443.<\/p>\n<p>\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0431\u043b\u043e\u043a\u0430 \u0432 Lu\u0430-\u043c\u0430\u0448\u0438\u043d\u0443 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430. \u0411\u043e\u043b\u0435\u0435 \u0438\u0437\u043e\u0449\u0440\u0435\u043d\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0438\u043f\u043e\u0432[<em>User\u2011Defined Types<\/em>](\u00a0<a href=\"https:\/\/www.lua.org\/pil\/28.html)\" rel=\"noopener noreferrer nofollow\">https:\/\/www.lua.org\/pil\/28.html)<\/a>, \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043b\u0435\u0436\u0438\u0442 \u0432\u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u0438.<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u0431\u043b\u043e\u043a \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 16-\u0431\u0438\u0442\u043d\u044b\u0445 \u043e\u0442\u0441\u0447\u0435\u0442\u043e\u0432 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c, \u0442\u043e \u0432 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0441\u0442\u0440\u043e\u043a\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0442\u0441\u0447\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u0432\u0443\u043c\u044f \u0431\u0430\u0439\u0442\u0430\u043c\u0438 \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<h3>8.2\u00a0\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h3>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e Lua-\u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u0443\u0434\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e. \u0412\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e, \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0430\u043a\u0442\u0443 \u0442\u0438\u043a\u0435\u0440\u0430. \u0411\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0447\u0430\u0441\u0442\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043a\u0430\u043a:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430\u00a0\u0441\u043a\u0440\u0438\u043f\u0442\u0430- \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0442\u0430\u043a\u0442\u0430 \u043e\u0442 \u0442\u0438\u043a\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0442\u0435\u043b\u043e\u00a0\u0441\u043a\u0440\u0438\u043f\u0442\u0430- \u044d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0430\u043a\u0442 \u0442\u0438\u043a\u0435\u0440\u0430 (10 \u043c\u0441).<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u044b \u0438 \u0442\u0435\u043b\u0430 \u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u044b LUA_FILTER_SET_PREAMBLE \u0438 LUA_FILTER_RUN \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<h4>8.2.1\u00a0\u041f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h4>\n<p>\u042d\u0442\u043e \u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 Lua-\u043a\u043e\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0442\u0435\u043b\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0430) \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u0435\u0440\u0432\u044b\u043c \u0442\u0430\u043a\u0442\u043e\u043c \u0442\u0438\u043a\u0435\u0440\u0430, \u0442\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0451 \u043a\u043e\u0434 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0442\u0438\u043a\u0435\u0440. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434 LUA_FILTER_SET_PREAMBLE, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 -\u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0438 \u0432\u0442\u043e\u0440\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u044b. \u041f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0443 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\/\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0444\u0438\u043b\u044c\u0442\u0440 \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0438 \u0432 \u043b\u044e\u0431\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u041f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u044b \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0435\u0451 \u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c \u0442\u0430\u043a\u0442\u0435.<\/p>\n<h4>8.2.2\u00a0\u0422\u0435\u043b\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h4>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u044b, \u044d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0430\u043a\u0442 \u0442\u0438\u043a\u0435\u0440\u0430 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u0430\u0436\u0434\u044b\u0435 10\u043c\u0441). \u0414\u0430\u043d\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\/\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0444\u0438\u043b\u044c\u0442\u0440 \u0432 \u043b\u044e\u0431\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u043c\u0435\u0442\u043e\u0434 LUA_FILTER_RUN \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0435.<\/p>\n<h4>8.2.3\u00a0\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h4>\n<p>\u0412 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c (\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u043f\u0430\u0443\u0437\u0443) \u043c\u0435\u0442\u043e\u0434\u043e\u043c LUA_FILTER_STOP. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0431\u043b\u043e\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 \u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u043c\u0438\u043d\u0443\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c. \u0412\u043e\u0437\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0432 \u043c\u0435\u0442\u043e\u0434 LUA_FILTER_RUN. \u041f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0432 \u0432\u043c\u0435\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0442\u0435\u043a\u0441\u0442 \u0442\u0435\u043b\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043b\u0438\u0431\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u0442\u0435\u043a\u0441\u0442.<\/p>\n<h4>8.2.4\u00a0\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043a\u0440\u0438\u043f\u0442 \u043c\u043e\u0433 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0441\u0442\u0440\u043e\u043a\u0443, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c<em>\u00a0get_sample()<\/em>\u00a0\u0438\u00a0<em>append_sample()<\/em>. \u041f\u0435\u0440\u0432\u0430\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u043e\u0442\u0441\u0447\u0435\u0442\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0434\u043b\u0438\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043e\u0442\u0441\u0447\u0435\u0442. \u0418\u0445 \u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435\u00a0<a href=\"#lis_access_data_funcs\" rel=\"noopener noreferrer nofollow\">8.1<\/a>.<\/p>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8.1:\u00a0\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c<\/p>\n<pre><code class=\"lua\">-- funcs.lua  -- \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u043e\u0434\u0438\u043d 16-\u0431\u0438\u0442\u043d\u044b\u0439 \u043e\u0442\u0441\u0447\u0435\u0442. function get_sample(s, sample_index) local byte_index = 2*sample_index - 1 local L = string.byte(s, byte_index) local H = string.byte(s, byte_index + 1) local v = 256 * H + L if (H >= 128) then v = - ((~(v - 1)) &amp; 65535) end return v end  -- \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u043e\u0434\u0438\u043d 16-\u0431\u0438\u0442\u043d\u044b\u0439 \u043e\u0442\u0441\u0447\u0435\u0442. function append_sample(s, sample_value) local v = math.floor(sample_value + 0.5) if v &lt; 0 then v = - v v = ((~v) + 1) &amp; 65535 end local H = v \/\/ 256 local L = v - H * 256 return  s .. string.char(L, H) end <\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<em>get_sample()<\/em>\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043e\u0442\u0441\u0447\u0435\u0442\u0430\u043c \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u043c\u0441\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0435. \u041e\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0434\u0438\u043d 16\u2011\u0431\u0438\u0442\u043d\u044b\u0439 \u043e\u0442\u0441\u0447\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438\u00a0<em>s<\/em>. \u041f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u043e\u0442\u0441\u0447\u0435\u0442\u0430\u00a0<em>sample_index()\u00a0<\/em>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u044b 2 \u0431\u0430\u0439\u0442\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043d \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f. \u0414\u0430\u043b\u0435\u0435 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0431\u0430\u0439\u0442\u043e\u0432 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f 16-\u0442\u0438 \u0431\u0438\u0442\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443, \u043e\u0442\u0441\u0447\u0435\u0442 \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c, \u0442\u043e \u044d\u0442\u0438 \u0431\u0430\u0439\u0442\u044b \u0445\u0440\u0430\u043d\u044f\u0442 \u0447\u0438\u0441\u043b\u043e \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0447\u0438\u0441\u043b\u043e \u043a \u043e\u0431\u044b\u0447\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 15-\u0433\u043e \u0431\u0438\u0442\u0430 \u0447\u0438\u0441\u043b\u0430. \u0415\u0441\u043b\u0438 \u043e\u043d \u0440\u0430\u0432\u0435\u043d 0 \u0442\u043e \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e. \u0415\u0441\u043b\u0438 \u0431\u0438\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u0442\u043e \u0447\u0438\u0441\u043b\u043e \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435. \u0422\u043e\u0433\u0434\u0430 \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0437 \u0447\u0438\u0441\u043b\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u044e \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u0438\u0442\u0430 \u0438 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u043d\u0430 \u20131.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<em>append_sample()\u00a0<\/em>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041e\u043d\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043a \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u0441\u0432\u043e\u0435\u043c\u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0443 (\u0441\u0442\u0440\u043e\u043a\u0435) \u0434\u0432\u0430 \u0431\u0430\u0439\u0442\u0430, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 (\u043e\u0442\u0441\u0447\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u043b\u0430) \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<p>\u0424\u0430\u0439\u043b \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f\u00a0<em>funcs.lua\u00a0<\/em>\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u0434 \u0444\u0438\u043b\u044c\u0442\u0440\u0430.<\/p>\n<h4>8.2.5\u00a0\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h4>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043a\u0432\u043e\u0437\u044c \u0441\u0435\u0431\u044f \u043d\u0435 \u043c\u0435\u043d\u044f\u044f \u0438\u0445.<\/p>\n<p>\u041f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435\u00a0<a href=\"#lis_script_preambula\" rel=\"noopener noreferrer nofollow\">8.2<\/a>:<\/p>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8.2:\u00a0\u041f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/p>\n<pre><code class=\"lua\">-- preambula2.lua -- \u042d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u043a\u0430\u043a \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430. -- \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c. require \"funcs\" preambula_status = 0 body_status = 0 -- \u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430. local greetings = 'Hello world from preambula!\\n' -- \u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435. print(greetings) return preambula_status <\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0435 \u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0441\u0438\u0433\u043d\u0430\u043b\u0430 (<em>funcs.lua<\/em>).<\/p>\n<p>\u0422\u0435\u043b\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435\u00a0<a href=\"#lis_script_body\" rel=\"noopener noreferrer nofollow\">8.3<\/a>:<\/p>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8.3:\u00a0\u0422\u0435\u043b\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/p>\n<pre><code class=\"lua\">-- body2.lua -- \u042d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0432 Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u043a\u0430\u043a \u0442\u0435\u043b\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430. -- \u041f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. lf_data_out =\"\" if lf_data_len == nil then print(\"Bad lf_data_len.\\n\") end for i = 1, lf_data_len\/2 do s = get_sample(lf_data, i) lf_data_out = append_sample(lf_data_out, s) end lf_data_out_len = string.len(lf_data_out) return body_status <\/code><\/pre>\n<p>\u0412 \u0442\u0435\u043b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0433\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0441\u0447\u0435\u0442\u044b \u0438\u0437 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u0435\u0436\u0434\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438\u00a0<em>get_sample()<\/em>\u00a0\u0438\u00a0<em>append_sample()\u00a0<\/em>\u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0441\u0447\u0435\u0442\u043e\u0432. \u0412\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0444\u0438\u043b\u044c\u0442\u0440 \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0442\u0441\u0447\u0435\u0442\u044b, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c\u0438 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0443\u0434\u043e\u0431\u043d\u043e \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0444\u0430\u0439\u043b\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445: \u0442\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430: \u0438 \u0432\u0430\u043c \u0441\u0442\u0430\u043d\u0435\u0442 \u044f\u0441\u043d\u043e, \u043a\u0430\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443.<\/p>\n<pre><code class=\"lua\">-- preambula2.lua<\/code><\/pre>\n<pre><code> Filter &lt;LUA_FILTER> Lua error. Lua error description:&lt;[string \"-- preambula2.lua ...\"]:12: attempt to perform arithmetic on a nil value>.<\/code><\/pre>\n<h3>8.3\u00a0\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/h3>\n<p>\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8.4: \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Lua-\u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/p>\n<pre><code class=\"cpp\">#ifndef lua_filter_h #define lua_filter_h \/* \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u043c\u0435\u0434\u0438\u0430\u0441\u0442\u0440\u0438\u043c\u0435\u0440\u0430. *\/ #include &lt;mediastreamer2\/msfilter.h> \/* \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 Lua. *\/ #include &lt;lua5.3\/lua.h> #include &lt;lua5.3\/lauxlib.h> #include &lt;lua5.3\/lualib.h> \/* \u0417\u0430\u0434\u0430\u0435\u043c \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043d\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430. \u042d\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u043d\u0438 \u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432.  \u0412 \u043c\u0435\u0434\u0438\u0430\u0441\u0442\u0440\u0438\u043c\u0435\u0440\u0435  \u0432 \u0444\u0430\u0439\u043b\u0435 allfilters.h \u0435\u0441\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 enum MSFilterId. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u0430\u043d\u044f\u0442\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b. \u041d\u043e \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0432<\/code><\/pre>\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-385432","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/385432","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=385432"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/385432\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=385432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=385432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=385432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}