{"id":299148,"date":"2020-02-24T09:00:08","date_gmt":"2020-02-24T09:00:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=299148"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-02-24T09:00:08","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=299148","title":{"rendered":"\u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 OpenAL \u043d\u0430 C++. \u0427\u0430\u0441\u0442\u044c 1: \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u0437\u0432\u0443\u043a"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/488744\/\">\u0412\u0430\u0448\u0435\u0439 \u0438\u0433\u0440\u0435 \u043d\u0443\u0436\u0435\u043d \u0437\u0432\u0443\u043a! \u041d\u0430\u0432\u0435\u0440\u043d\u043e, \u0432\u044b \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 OpenGL \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435. \u0412\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u0435\u0433\u043e API, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0438\u0441\u044c \u043a <a href=\"https:\/\/en.wikipedia.org\/wiki\/OpenAL\" rel=\"nofollow\">OpenAL<\/a>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c.<\/p>\n<p>  \u0427\u0442\u043e \u0436\u0435, \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u2014 OpenAL \u0442\u043e\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 API. \u041e\u043d \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u0438\u043c\u0438\u0442\u0430\u0446\u0438\u0438 API \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenGL. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u0435\u0433\u043e \u0441\u0440\u0435\u0434\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0434\u043b\u044f \u0438\u0433\u0440; \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043e\u043d \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f OpenAL \u0432 \u0438\u0433\u0440\u0435, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 C++. \u041c\u044b \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u0437\u0432\u0443\u043a\u0438, \u043c\u0443\u0437\u044b\u043a\u0443 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0432\u0443\u043a\u0430 \u0432 3D-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<h2>\u0418\u0441\u0442\u043e\u0440\u0438\u044f OpenAL<\/h2>\n<p>  \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0431\u044b\u0442\u044c \u043a\u0440\u0430\u0442\u043a\u0438\u043c. \u041a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u043e\u0441\u044c \u0432\u044b\u0448\u0435, \u043e\u043d \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f \u043a\u0430\u043a \u0438\u043c\u0438\u0442\u0430\u0446\u0438\u044f OpenGL API, \u0438 \u043d\u0430 \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u0430. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0439 API, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043d\u043e\u0433\u0438\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d, \u0438 \u0435\u0441\u043b\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u2014 \u043e\u0434\u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0430 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430, \u0442\u043e \u0437\u0432\u0443\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e OpenAL \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0441\u0442\u0430\u0442\u044c open-source, \u043d\u043e \u043f\u043e\u0442\u043e\u043c \u043a\u043e\u0435-\u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e\u2026<\/p>\n<p>  \u041b\u044e\u0434\u0435\u0439 \u043d\u0435 \u0442\u0430\u043a \u0441\u0438\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0437\u0432\u0443\u043a, \u043a\u0430\u043a \u0433\u0440\u0430\u0444\u0438\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 Creative \u0441\u0434\u0435\u043b\u0430\u043b\u0430 OpenAL \u0441\u0432\u043e\u0435\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e, \u0430 <em>\u044d\u0442\u0430\u043b\u043e\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/em> \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u043f\u0440\u0438\u0435\u0442\u0430\u0440\u043d\u0430 \u0438 \u043d\u0435\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430. \u041d\u043e! <em>\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f<\/em> OpenAL \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u00ab\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c\u00bb \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u043e\u043d\u0430 <a href=\"https:\/\/openal.org\/documentation\/openal-1.1-specification.pdf\" rel=\"nofollow\">\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442\u0441\u044f<\/a>.<\/p>\n<p>  \u0412\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0432\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043d\u043e \u0438\u0445 \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e. \u0417\u0432\u0443\u043a \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e, \u043a\u0430\u043a \u0433\u0440\u0430\u0444\u0438\u043a\u0430, \u0432\u0435\u0434\u044c \u043e\u0441\u043e\u0431\u043e\u0439 \u043d\u0443\u0436\u0434\u044b \u043a \u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u0442.<\/p>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0442\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u0430 \u0434\u0440\u0443\u0433\u0438\u043c \u043b\u044e\u0434\u044f\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c open-source-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/kcat\/openal-soft\" rel=\"nofollow\">OpenAL Soft<\/a>, \u0438, \u0447\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430 \u0438\u0441\u043a\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435. \u042d\u0442\u043e \u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044f, \u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0436\u0435.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041e\u043d\u0430 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u0430\u044f. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043e\u043d\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e \u2014 \u043f\u043e \u0441\u0443\u0442\u0438, \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0435 API, \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0412 Windows \u043e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <a href=\"https:\/\/en.wikipedia.org\/wiki\/DirectSound\" rel=\"nofollow\">DirectSound<\/a>, \u0432 Unix \u2014 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Open_Sound_System\" rel=\"nofollow\">OSS<\/a>. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0430 \u0438 \u0441\u043c\u043e\u0433\u043b\u0430 \u0441\u0442\u0430\u0442\u044c \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0439; \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u044d\u0442\u043e \u0433\u0440\u043e\u043c\u043a\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0431\u0451\u0440\u0442\u043a\u0438 API.<\/p>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0430\u0441 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e API. \u041d\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0432\u043e\u043b\u043d\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u042d\u0442\u043e \u0436\u0435 \u0437\u0432\u0443\u043a, \u0430 \u043e\u043d \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u043c\u0443 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u043c API.<\/p>\n<p>  \u041d\u043e \u0445\u0432\u0430\u0442\u0438\u0442 \u0438\u0441\u0442\u043e\u0440\u0438\u0438, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c.<\/p>\n<h2>\u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 OpenAL?<\/h2>\n<p>  \u041d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c OpenAL Soft \u0432 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0432\u0430\u043c\u0438 \u0442\u0443\u043b\u0447\u0435\u0439\u043d\u0435. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438 <a href=\"https:\/\/github.com\/kcat\/openal-soft\" rel=\"nofollow\">\u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Source Install<\/a>. \u0423 \u043c\u0435\u043d\u044f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e \u0441 \u044d\u0442\u0438\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043d\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u0438\u044f, \u0442\u043e \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043f\u043e\u0434 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u043e\u043c \u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u043b\u0438 <a href=\"http:\/\/openal.org\/mailman\/listinfo\/openal\" rel=\"nofollow\">\u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 OpenAL Soft<\/a>.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0445 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0430\u0443\u0434\u0438\u043e\u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0443\u0444\u0435\u0440\u044b \u0438 \u0442\u043e\u043d\u043a\u0438\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0430\u0443\u0434\u0438\u043e\u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043e <a href=\"https:\/\/indiegamedev.net\/2020\/01\/16\/how-to-stream-ogg-files-with-openal-in-c\/\" rel=\"nofollow\">\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u043e\u043c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 Ogg\/Vorbis<\/a>. \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 WAV \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430, \u043e\u0431 \u044d\u0442\u043e\u043c \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u043e\u0442\u043d\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435.<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0443 \u043f\u043e\u0438\u0441\u043a\u0430 \u0430\u0443\u0434\u0438\u043e\u0444\u0430\u0439\u043b\u043e\u0432 \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0440\u0435\u0448\u0430\u0442\u044c \u0441\u0430\u043c\u0438\u043c. \u0412 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0448\u0443\u043c\u043e\u0432 \u0438 \u0432\u0437\u0440\u044b\u0432\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043b\u0443\u0445, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/indiegamedev.net\/2020\/01\/24\/how-to-make-quick-chip-tune-music-for-your-game\/\" rel=\"nofollow\">\u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0447\u0438\u043f\u0442\u044e\u043d-\u043c\u0443\u0437\u044b\u043a\u0443<\/a> [<a href=\"https:\/\/habr.com\/ru\/post\/488436\/\">\u043f\u0435\u0440\u0435\u0432\u043e\u0434<\/a> \u043d\u0430 \u0425\u0430\u0431\u0440\u0435].<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u0435\u0440\u0436\u0438\u0442\u0435 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 <a href=\"https:\/\/github.com\/kcat\/openal-soft\/wiki\/Programmer%27s-Guide\" rel=\"nofollow\">Programmers Guide from OpenALSoft<\/a>. \u042d\u0442\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435 pdf \u0441 \u00ab\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439\u00bb \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439.<\/p>\n<p>  \u0412\u043e\u0442, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438 \u0432\u0441\u0451. \u0411\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c IDE \u0438 \u0442\u0443\u043b\u0447\u0435\u0439\u043d.<\/p>\n<h2>\u041e\u0431\u0437\u043e\u0440 OpenAL API<\/h2>\n<p>  \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u043e\u043d \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 OpenGL API. \u0421\u0445\u043e\u0436\u0435\u0441\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u0445 \u0438 \u0432\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442\u0435 \u0441 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430\u043c\u0438\/\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438, \u0430 \u043d\u0435 \u0441 \u0441\u0430\u043c\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e.<\/p>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u043c\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 API \u0432 OpenGL \u0438 OpenAL, \u043d\u043e \u043e\u043d\u0438 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b. \u0412 OpenGL \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u041e\u0421. \u042d\u0442\u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u041e\u0421 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b \u0438 <i>\u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435<\/i> \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenGL. \u0412 OpenAL \u0432\u0441\u0451 \u0438\u043d\u0430\u0447\u0435 \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<p>  \u041f\u0440\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441 API \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u0440\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442\u0435. <strong>Listeners<\/strong> (\u00ab\u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0438\u00bb) \u2014 \u044d\u0442\u043e \u043c\u0435\u0441\u0442\u043e\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u00ab\u0443\u0448\u0435\u0439\u00bb, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0432 3D-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 (\u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d listener). <strong>Sources<\/strong> (\u00ab\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438\u00bb) \u2014 \u044d\u0442\u043e \u00ab\u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0438\u00bb, \u0438\u0437\u0434\u0430\u044e\u0449\u0438\u0435 \u0437\u0432\u0443\u043a, \u043e\u043f\u044f\u0442\u044c-\u0442\u0430\u043a\u0438 \u0432 3D-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435. Listener \u0438 sources \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u0432\u044b \u0441\u043b\u044b\u0448\u0438\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0438 \u0432 \u0438\u0433\u0440\u0435.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u2014 \u044d\u0442\u043e <strong>buffers<\/strong> (\u00ab\u0431\u0443\u0444\u0435\u0440\u044b\u00bb). \u0412 \u043d\u0438\u0445 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0441\u044d\u043c\u043f\u043b\u044b \u0437\u0432\u0443\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 sources \u0431\u0443\u0434\u0443\u0442 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0434\u043b\u044f listeners.<\/p>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u0430\u043a\u0436\u0435 <strong>modes<\/strong> (\u00ab\u0440\u0435\u0436\u0438\u043c\u044b\u00bb), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0433\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0432\u0443\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 OpenAL.<\/p>\n<h3>Sources<\/h3>\n<p>  \u041a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u043e\u0441\u044c \u0432\u044b\u0448\u0435, \u044d\u0442\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438 \u0437\u0432\u0443\u043a\u043e\u0432. \u0418\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043e\u043d\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0431\u0443\u0444\u0435\u0440\u043e\u043c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u044b\u0445 \u0430\u0443\u0434\u0438\u043e\u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h3>Listener<\/h3>\n<p>  \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442 \u00ab\u0443\u0448\u0435\u0439\u00bb \u0432 \u0438\u0433\u0440\u0435. \u0422\u043e, \u0447\u0442\u043e \u0441\u043b\u044b\u0448\u0438\u0442 listener, \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430. \u041e\u043d \u0442\u043e\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<h3>Buffers<\/h3>\n<p>  \u0412 OpenGL \u0438\u0445 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Texture2D. \u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u0430\u0443\u0434\u0438\u043e\u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 source.<\/p>\n<h3>\u0422\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, OpenAL \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438 \u0437\u0430\u0434\u0430\u0451\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043e\u043d \u0442\u0430\u043a \u0442\u043e\u0447\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 OpenGL, \u0447\u0442\u043e \u043c\u044b \u0434\u0430\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0442\u0438\u043f\u044b OpenAL \u0432 \u0442\u0438\u043f\u044b OpenGL. \u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0438\u0436\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u043e\u043d\u0438 \u0438 \u0438\u0445 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u044b.<\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>\u0422\u0438\u043f OpenAL<\/th>\n<th>\u0422\u0438\u043f OpenALC<\/th>\n<th>\u0422\u0438\u043f OpenGL<\/th>\n<th>C++ Typedef<\/th>\n<th>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>ALboolean<\/code><\/td>\n<td><code>ALCboolean<\/code><\/td>\n<td><code>GLboolean<\/code><\/td>\n<td><code>std::int8_t<\/code><\/td>\n<td>8-\u0431\u0438\u0442\u043d\u043e\u0435 \u0431\u0443\u043b\u0435\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/td>\n<\/tr>\n<tr>\n<td><code>ALbyte<\/code><\/td>\n<td><code>ALCbyte<\/code><\/td>\n<td><code>GLbyte<\/code><\/td>\n<td><code>std::int8_t<\/code><\/td>\n<td>8-\u0431\u0438\u0442\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Two%27s_complement\" rel=\"nofollow\">\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/a> \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c<\/td>\n<\/tr>\n<tr>\n<td><code>ALubyte<\/code><\/td>\n<td><code>ALCubyte<\/code><\/td>\n<td><code>GLubyte<\/code><\/td>\n<td><code>std::uint8_t<\/code><\/td>\n<td>8-\u0431\u0438\u0442\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u0437\u043d\u0430\u043a\u0430<\/td>\n<\/tr>\n<tr>\n<td><code>ALchar<\/code><\/td>\n<td><code>ALCchar<\/code><\/td>\n<td><code>GLchar<\/code><\/td>\n<td><code>char<\/code><\/td>\n<td>\u0441\u0438\u043c\u0432\u043e\u043b<\/td>\n<\/tr>\n<tr>\n<td><code>ALshort<\/code><\/td>\n<td><code>ALCshort<\/code><\/td>\n<td><code>GLshort<\/code><\/td>\n<td><code>std::int16_t<\/code><\/td>\n<td>16-\u0431\u0438\u0442\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c<\/td>\n<\/tr>\n<tr>\n<td><code>ALushort<\/code><\/td>\n<td><code>ALCushort<\/code><\/td>\n<td><code>GLushort<\/code><\/td>\n<td><code>std::uint16_t<\/code><\/td>\n<td>16-\u0431\u0438\u0442\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u0437\u043d\u0430\u043a\u0430<\/td>\n<\/tr>\n<tr>\n<td><code>ALint<\/code><\/td>\n<td><code>ALCint<\/code><\/td>\n<td><code>GLint<\/code><\/td>\n<td><code>std::int32_t<\/code><\/td>\n<td>32-\u0431\u0438\u0442\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c<\/td>\n<\/tr>\n<tr>\n<td><code>ALuint<\/code><\/td>\n<td><code>ALCuint<\/code><\/td>\n<td><code>GLuint<\/code><\/td>\n<td><code>std::uint32_t<\/code><\/td>\n<td>32-\u0431\u0438\u0442\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u0437\u043d\u0430\u043a\u0430<\/td>\n<\/tr>\n<tr>\n<td><code>ALsizei<\/code><\/td>\n<td><code>ALCsizei<\/code><\/td>\n<td><code>GLsizei<\/code><\/td>\n<td><code>std::int32_t<\/code><\/td>\n<td>\u043d\u0435\u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 32-\u0431\u0438\u0442\u043d\u043e\u0435 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/td>\n<\/tr>\n<tr>\n<td><code>ALenum<\/code><\/td>\n<td><code>ALCenum<\/code><\/td>\n<td><code>GLenum<\/code><\/td>\n<td><code>std::uint32_t<\/code><\/td>\n<td>\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043c\u043e\u0435 32-\u0431\u0438\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/td>\n<\/tr>\n<tr>\n<td><code>ALfloat<\/code><\/td>\n<td><code>ALCfloat<\/code><\/td>\n<td><code>GLfloat<\/code><\/td>\n<td><code>float<\/code><\/td>\n<td>32-\u0431\u0438\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 <a href=\"https:\/\/en.wikipedia.org\/wiki\/IEEE_754\" rel=\"nofollow\">IEEE 754<\/a><\/td>\n<\/tr>\n<tr>\n<td><code>ALdouble<\/code><\/td>\n<td><code>ALCdouble<\/code><\/td>\n<td><code>GLdouble<\/code><\/td>\n<td><code>double<\/code><\/td>\n<td>64-\u0431\u0438\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 IEEE 754<\/td>\n<\/tr>\n<tr>\n<td><code>ALvoid<\/code><\/td>\n<td><code>ALCvoid<\/code><\/td>\n<td><code>GLvoid<\/code><\/td>\n<td><code>void<\/code><\/td>\n<td>\u043f\u0443\u0441\u0442\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  <\/p>\n<h2>\u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a OpenAL<\/h2>\n<p>  \u0415\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a <a href=\"https:\/\/indiegamedev.net\/2020\/01\/17\/c-openal-function-call-wrapping\/\" rel=\"nofollow\">\u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a OpenAL<\/a>, \u043d\u043e \u0440\u0430\u0434\u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044e \u0435\u0451 \u0437\u0434\u0435\u0441\u044c. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0430 <em>\u0442\u0438\u043f\u0430<\/em> \u0432\u044b\u0437\u043e\u0432\u043e\u0432 OpenAL API: \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u044b\u0435.<\/p>\n<p>  \u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 <code>alc<\/code>, \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 win32-\u0432\u044b\u0437\u043e\u0432\u044b OpenGL \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0438\u043b\u0438 \u0438\u0445 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 \u0432 Linux. \u0417\u0432\u0443\u043a \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0432\u0435\u0449\u044c, \u0447\u0442\u043e\u0431\u044b \u0443 \u0432\u0441\u0435\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0431\u044b\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b. \u041e\u0431\u044b\u0447\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 <code>al<\/code>. \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u0430\u0445 \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c <code>alcGetError<\/code>; \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c <code>alGetError<\/code>. \u041e\u043d\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>ALCenum<\/code>, \u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>ALenum<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u043b\u0443\u0447\u0430\u0439, \u043d\u043e \u0432\u043e \u0432\u0441\u0451\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043d\u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b <code>al<\/code>. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0430\u043a\u0440\u043e\u0441 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0443\u0447\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439:<\/p>\n<pre><code class=\"cpp\">#define alCall(function, ...) alCallImpl(__FILE__, __LINE__, function, __VA_ARGS__)<\/code><\/pre>\n<p>  \u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0432\u0430\u0448 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c <code>__FILE__<\/code> \u0438\u043b\u0438 <code>__LINE__<\/code>, \u043d\u043e, \u0447\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u044f \u0431\u044b\u043b \u0431\u044b \u0443\u0434\u0438\u0432\u043b\u0451\u043d, \u0435\u0441\u043b\u0438 \u0431\u044b \u044d\u0442\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0442\u0430\u043a. <code>__VA_ARGS__<\/code> \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u043c\u0443 \u043c\u0430\u043a\u0440\u043e\u0441\u0443.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0441\u043e\u043e\u0431\u0449\u0451\u043d\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"cpp\">bool check_al_errors(const std::string&amp; filename, const std::uint_fast32_t line) {     ALenum error = alGetError();     if(error != AL_NO_ERROR)     {         std::cerr &lt;&lt; &quot;***ERROR*** (&quot; &lt;&lt; filename &lt;&lt; &quot;: &quot; &lt;&lt; line &lt;&lt; &quot;)\\n&quot; ;         switch(error)         {         case AL_INVALID_NAME:             std::cerr &lt;&lt; &quot;AL_INVALID_NAME: a bad name (ID) was passed to an OpenAL function&quot;;             break;         case AL_INVALID_ENUM:             std::cerr &lt;&lt; &quot;AL_INVALID_ENUM: an invalid enum value was passed to an OpenAL function&quot;;             break;         case AL_INVALID_VALUE:             std::cerr &lt;&lt; &quot;AL_INVALID_VALUE: an invalid value was passed to an OpenAL function&quot;;             break;         case AL_INVALID_OPERATION:             std::cerr &lt;&lt; &quot;AL_INVALID_OPERATION: the requested operation is not valid&quot;;             break;         case AL_OUT_OF_MEMORY:             std::cerr &lt;&lt; &quot;AL_OUT_OF_MEMORY: the requested operation resulted in OpenAL running out of memory&quot;;             break;         default:             std::cerr &lt;&lt; &quot;UNKNOWN AL ERROR: &quot; &lt;&lt; error;         }         std::cerr &lt;&lt; std::endl;         return false;     }     return true; }<\/code><\/pre>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e. \u041e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0432 \u043a\u043e\u0434\u0435 \u2014 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0431 \u044d\u0442\u0438\u0445 \u043e\u0448\u0438\u0431\u043a\u0430\u0445, \u043d\u043e \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0434\u0432\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u00ab\u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u00bb \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u0432\u044b\u0437\u043e\u0432\u044b OpenGL.<\/p>\n<pre><code class=\"cpp\">template&lt;typename alFunction, typename... Params&gt; auto alCallImpl(const char* filename,                  const std::uint_fast32_t line,                  alFunction function,                  Params... params) -&gt;typename std::enable_if_t&lt;!std::is_same_v&lt;void,decltype(function(params...))&gt;,decltype(function(params...))&gt; {     auto ret = function(std::forward&lt;Params&gt;(params)...);     check_al_errors(filename,line);     return ret; }  template&lt;typename alcFunction, typename... Params&gt; auto alcCallImpl(const char* filename,                   const std::uint_fast32_t line,                   alcFunction function,                   ALCdevice* device,                   Params... params) -&gt;typename std::enable_if_t&lt;std::is_same_v&lt;void,decltype(function(params...))&gt;,bool&gt; {     function(std::forward&lt;Params&gt;(params)...);     return check_alc_errors(filename,line,device); }<\/code><\/pre>\n<p>  \u0418\u0445 \u0434\u0432\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 OpenAL, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0445 <code>void<\/code>, \u0430 \u0432\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435\u043f\u0443\u0441\u0442\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u043c\u0435\u0442\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432 C++, \u0442\u043e \u0432\u0437\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u0441 <code>std::enable_if<\/code>. \u041e\u043d\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0442\u043e, \u043a\u0430\u043a\u0438\u0435 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <code>alc<\/code>:<\/p>\n<pre><code class=\"cpp\">#define alcCall(function, device, ...) alcCallImpl(__FILE__, __LINE__, function, device, __VA_ARGS__)  bool check_alc_errors(const std::string&amp; filename, const std::uint_fast32_t line, ALCdevice* device) {     ALCenum error = alcGetError(device);     if(error != ALC_NO_ERROR)     {         std::cerr &lt;&lt; &quot;***ERROR*** (&quot; &lt;&lt; filename &lt;&lt; &quot;: &quot; &lt;&lt; line &lt;&lt; &quot;)\\n&quot; ;         switch(error)         {         case ALC_INVALID_VALUE:             std::cerr &lt;&lt; &quot;ALC_INVALID_VALUE: an invalid value was passed to an OpenAL function&quot;;             break;         case ALC_INVALID_DEVICE:             std::cerr &lt;&lt; &quot;ALC_INVALID_DEVICE: a bad device was passed to an OpenAL function&quot;;             break;         case ALC_INVALID_CONTEXT:             std::cerr &lt;&lt; &quot;ALC_INVALID_CONTEXT: a bad context was passed to an OpenAL function&quot;;             break;         case ALC_INVALID_ENUM:             std::cerr &lt;&lt; &quot;ALC_INVALID_ENUM: an unknown enum value was passed to an OpenAL function&quot;;             break;         case ALC_OUT_OF_MEMORY:             std::cerr &lt;&lt; &quot;ALC_OUT_OF_MEMORY: an unknown enum value was passed to an OpenAL function&quot;;             break;         default:             std::cerr &lt;&lt; &quot;UNKNOWN ALC ERROR: &quot; &lt;&lt; error;         }         std::cerr &lt;&lt; std::endl;         return false;     }     return true; }  template&lt;typename alcFunction, typename... Params&gt; auto alcCallImpl(const char* filename,                   const std::uint_fast32_t line,                   alcFunction function,                   ALCdevice* device,                   Params... params) -&gt;typename std::enable_if_t&lt;std::is_same_v&lt;void,decltype(function(params...))&gt;,bool&gt; {     function(std::forward&lt;Params&gt;(params)...);     return check_alc_errors(filename,line,device); }  template&lt;typename alcFunction, typename ReturnType, typename... Params&gt; auto alcCallImpl(const char* filename,                  const std::uint_fast32_t line,                  alcFunction function,                  ReturnType&amp; returnValue,                  ALCdevice* device,                   Params... params) -&gt;typename std::enable_if_t&lt;!std::is_same_v&lt;void,decltype(function(params...))&gt;,bool&gt; {     returnValue = function(std::forward&lt;Params&gt;(params)...);     return check_alc_errors(filename,line,device); }<\/code><\/pre>\n<p>  \u0421\u0430\u043c\u043e\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <code>device<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b <code>alc<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u0442\u0438\u043b\u044f <code>ALCenum<\/code> \u0438 <code>ALC_<\/code>. \u041e\u043d\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u043c\u0438, \u0438 \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u043b\u0433\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441 <code>al<\/code> \u043d\u0430 <code>alc<\/code> \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u0440\u0435\u0434\u0438\u043b\u0438 \u043c\u043e\u0435\u043c\u0443 \u043a\u043e\u0434\u0443 \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u043b \u0447\u0442\u0435\u043d\u0438\u0435 \u043f\u0440\u044f\u043c\u043e \u043f\u043e\u0432\u0435\u0440\u0445 \u044d\u0442\u043e\u0433\u043e <code>c<\/code>.<\/p>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0451. \u041e\u0431\u044b\u0447\u043d\u043e \u0432\u044b\u0437\u043e\u0432 OpenAL \u043d\u0430 C++ \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">\/* example #1 *\/ alGenSources(1, &amp;source); ALenum error = alGetError(); if(error != AL_NO_ERROR) {     \/* handle different possibilities *\/ }  \/* example #2 *\/ alcCaptureStart(&amp;device); ALCenum error = alcGetError(); if(error != ALC_NO_ERROR) {     \/* handle different possibilities *\/ }  \/* example #3 *\/ const ALchar* sz = alGetString(param); ALenum error = alGetError(); if(error != AL_NO_ERROR) {     \/* handle different possibilities *\/ }  \/* example #4 *\/ const ALCchar* sz = alcGetString(&amp;device, param); ALCenum error = alcGetError(); if(error != ALC_NO_ERROR) {     \/* handle different possibilities *\/ }<\/code><\/pre>\n<p>  \u041d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">\/* example #1 *\/ if(!alCall(alGenSources, 1, &amp;source)) {     \/* error occurred *\/ }  \/* example #2 *\/ if(!alcCall(alcCaptureStart, &amp;device)) {     \/* error occurred *\/ }  \/* example #3 *\/ const ALchar* sz; if(!alCall(alGetString, sz, param)) {     \/* error occurred *\/ }  \/* example #4 *\/ const ALCchar* sz; if(!alcCall(alcGetString, sz, &amp;device, param)) {     \/* error occurred *\/ }<\/code><\/pre>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043b\u044f \u0432\u0430\u0441 \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u043d\u043e \u043c\u043d\u0435 \u0442\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u0435\u0435. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<h2>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 .wav<\/h2>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u043b\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0438\u0445 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443. \u0412\u043e\u0442 <a href=\"https:\/\/github.com\/adamstark\/AudioFile\" rel=\"nofollow\">open-source-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 .wav<\/a>. \u042f \u0441\u0443\u043c\u0430\u0441\u0448\u0435\u0434\u0448\u0438\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0435\u043b\u0430\u044e \u044d\u0442\u043e \u0441\u0430\u043c:<\/p>\n<pre><code class=\"cpp\">std::int32_t convert_to_int(char* buffer, std::size_t len) {     std::int32_t a = 0;     if(std::endian::native == std::endian::little)         std::memcpy(&amp;a, buffer, len);     else         for(std::size_t i = 0; i &lt; len; ++i)             reinterpret_cast&lt;char*&gt;(&amp;a)[3 - i] = buffer[i];     return a; }  bool load_wav_file_header(std::ifstream&amp; file,                           std::uint8_t&amp; channels,                           std::int32_t&amp; sampleRate,                           std::uint8_t&amp; bitsPerSample,                           ALsizei&amp; size) {     char buffer[4];     if(!file.is_open())         return false;      \/\/ the RIFF     if(!file.read(buffer, 4))     {         std::cerr &lt;&lt; &quot;ERROR: could not read RIFF&quot; &lt;&lt; std::endl;         return false;     }     if(std::strncmp(buffer, &quot;RIFF&quot;, 4) != 0)     {         std::cerr &lt;&lt; &quot;ERROR: file is not a valid WAVE file (header doesn't begin with RIFF)&quot; &lt;&lt; std::endl;         return false;     }      \/\/ the size of the file     if(!file.read(buffer, 4))     {         std::cerr &lt;&lt; &quot;ERROR: could not read size of file&quot; &lt;&lt; std::endl;         return false;     }      \/\/ the WAVE     if(!file.read(buffer, 4))     {         std::cerr &lt;&lt; &quot;ERROR: could not read WAVE&quot; &lt;&lt; std::endl;         return false;     }     if(std::strncmp(buffer, &quot;WAVE&quot;, 4) != 0)     {         std::cerr &lt;&lt; &quot;ERROR: file is not a valid WAVE file (header doesn't contain WAVE)&quot; &lt;&lt; std::endl;         return false;     }      \/\/ &quot;fmt\/0&quot;     if(!file.read(buffer, 4))     {         std::cerr &lt;&lt; &quot;ERROR: could not read fmt\/0&quot; &lt;&lt; std::endl;         return false;     }      \/\/ this is always 16, the size of the fmt data chunk     if(!file.read(buffer, 4))     {         std::cerr &lt;&lt; &quot;ERROR: could not read the 16&quot; &lt;&lt; std::endl;         return false;     }      \/\/ PCM should be 1?     if(!file.read(buffer, 2))     {         std::cerr &lt;&lt; &quot;ERROR: could not read PCM&quot; &lt;&lt; std::endl;         return false;     }      \/\/ the number of channels     if(!file.read(buffer, 2))     {         std::cerr &lt;&lt; &quot;ERROR: could not read number of channels&quot; &lt;&lt; std::endl;         return false;     }     channels = convert_to_int(buffer, 2);      \/\/ sample rate     if(!file.read(buffer, 4))     {         std::cerr &lt;&lt; &quot;ERROR: could not read sample rate&quot; &lt;&lt; std::endl;         return false;     }     sampleRate = convert_to_int(buffer, 4);      \/\/ (sampleRate * bitsPerSample * channels) \/ 8     if(!file.read(buffer, 4))     {         std::cerr &lt;&lt; &quot;ERROR: could not read (sampleRate * bitsPerSample * channels) \/ 8&quot; &lt;&lt; std::endl;         return false;     }      \/\/ ?? dafaq     if(!file.read(buffer, 2))     {         std::cerr &lt;&lt; &quot;ERROR: could not read dafaq&quot; &lt;&lt; std::endl;         return false;     }      \/\/ bitsPerSample     if(!file.read(buffer, 2))     {         std::cerr &lt;&lt; &quot;ERROR: could not read bits per sample&quot; &lt;&lt; std::endl;         return false;     }     bitsPerSample = convert_to_int(buffer, 2);      \/\/ data chunk header &quot;data&quot;     if(!file.read(buffer, 4))     {         std::cerr &lt;&lt; &quot;ERROR: could not read data chunk header&quot; &lt;&lt; std::endl;         return false;     }     if(std::strncmp(buffer, &quot;data&quot;, 4) != 0)     {         std::cerr &lt;&lt; &quot;ERROR: file is not a valid WAVE file (doesn't have 'data' tag)&quot; &lt;&lt; std::endl;         return false;     }      \/\/ size of data     if(!file.read(buffer, 4))     {         std::cerr &lt;&lt; &quot;ERROR: could not read data size&quot; &lt;&lt; std::endl;         return false;     }     size = convert_to_int(buffer, 4);      \/* cannot be at the end of file *\/     if(file.eof())     {         std::cerr &lt;&lt; &quot;ERROR: reached EOF on the file&quot; &lt;&lt; std::endl;         return false;     }     if(file.fail())     {         std::cerr &lt;&lt; &quot;ERROR: fail state set on the file&quot; &lt;&lt; std::endl;         return false;     }      return true; }  char* load_wav(const std::string&amp; filename,                std::uint8_t&amp; channels,                std::int32_t&amp; sampleRate,                std::uint8_t&amp; bitsPerSample,                ALsizei&amp; size) {     std::ifstream in(filename, std::ios::binary);     if(!in.is_open())     {         std::cerr &lt;&lt; &quot;ERROR: Could not open \\&quot;&quot; &lt;&lt; filename &lt;&lt; &quot;\\&quot;&quot; &lt;&lt; std::endl;         return nullptr;     }     if(!load_wav_file_header(in, channels, sampleRate, bitsPerSample, size))     {         std::cerr &lt;&lt; &quot;ERROR: Could not load wav header of \\&quot;&quot; &lt;&lt; filename &lt;&lt; &quot;\\&quot;&quot; &lt;&lt; std::endl;         return nullptr;     }      char* data = new char[size];      in.read(data, size);      return data; }<\/code><\/pre>\n<p>  \u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0442\u044c \u043a\u043e\u0434, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0432 \u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438; \u043d\u043e \u043e\u043d \u043e\u0447\u0435\u043d\u044c \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d, \u0435\u0441\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0441\u043e <a href=\"http:\/\/soundfile.sapp.org\/doc\/WaveFormat\/\" rel=\"nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0444\u0430\u0439\u043b\u0430 WAV<\/a>.<\/p>\n<h2>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c OpenAL, \u0430 \u043f\u043e\u0442\u043e\u043c, \u043a\u0430\u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443, \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0435\u0433\u043e, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c \u0441 \u043d\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443. \u041f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>ALCdevice<\/code> (\u0437\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u044d\u0442\u043e <code>ALC<\/code>, \u0430 <i>\u043d\u0435<\/i> <code>AL<\/code>), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0447\u0442\u043e \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0444\u043e\u043d\u043e\u0432\u043e\u0439 \u043c\u0443\u0437\u044b\u043a\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <code>ALCcontext<\/code>.<\/p>\n<p>  <code>ALCdevice<\/code> \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u044b\u0431\u043e\u0440\u0443 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0430\u0440\u0442\u044b. \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0448\u0430 OpenGL-\u0438\u0433\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433. <code>ALCcontext<\/code> \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c (\u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u0431\u0440\u0430\u0437\u043e\u043c) \u0434\u043b\u044f OpenGL.<\/p>\n<h3>ALCdevice<\/h3>\n<p>  OpenAL Device \u2014 \u044d\u0442\u043e \u0442\u043e, \u0447\u0435\u0440\u0435\u0437 \u0447\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u043e\u0434 \u0437\u0432\u0443\u043a\u0430, \u0431\u0443\u0434\u044c \u0442\u043e \u0437\u0432\u0443\u043a\u043e\u0432\u0430\u044f \u043a\u0430\u0440\u0442\u0430 \u0438\u043b\u0438 \u0447\u0438\u043f, \u043d\u043e \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 <code>iostream<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u043a\u0440\u0430\u043d\u0430 \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u043e\u043c, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u043c \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0433\u0440 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0437\u0432\u0443\u043a\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<p>  \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0438\u0445 \u0442\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439:<\/p>\n<pre><code class=\"cpp\">bool get_available_devices(std::vector&lt;std::string&gt;&amp; devicesVec, ALCdevice* device) {     const ALCchar* devices;     if(!alcCall(alcGetString, devices, device, nullptr, ALC_DEVICE_SPECIFIER))         return false;      const char* ptr = devices;      devicesVec.clear();      do     {         devicesVec.push_back(std::string(ptr));         ptr += devicesVec.back().size() + 1;     }     while(*(ptr + 1) != '\\0');      return true; }<\/code><\/pre>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u0432\u043e\u043a\u0440\u0443\u0433 \u0432\u044b\u0437\u043e\u0432\u0430 <code>alcGetString<\/code>. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u0440\u043e\u043a, \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <code>null<\/code> \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0434\u0432\u0443\u043c\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 <code>null<\/code>. \u0417\u0434\u0435\u0441\u044c \u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0435\u0433\u043e \u0432 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043b\u044f \u043d\u0430\u0441 \u0432\u0435\u043a\u0442\u043e\u0440.<\/p>\n<p>  \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u043b\u0430\u0442\u044c! \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u0430\u043a \u044f \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0433\u0440 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0432\u0443\u043a \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u0430\u043a\u0438\u043c \u0431\u044b \u043e\u043d\u043e \u043d\u0438 \u0431\u044b\u043b\u043e. \u042f \u043d\u0435\u0447\u0430\u0441\u0442\u043e \u0432\u0438\u0436\u0443 \u043e\u043f\u0446\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0430\u0443\u0434\u0438\u043e\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0432\u0443\u043a. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 OpenAL Device \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u044b\u0437\u043e\u0432 <code>alcOpenDevice<\/code>. \u042d\u0442\u043e\u0442 \u0432\u044b\u0437\u043e\u0432 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d \u043d\u0435 \u0437\u0430\u0434\u0430\u0451\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <code>alcGetError<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"cpp\">ALCdevice* openALDevice = alcOpenDevice(nullptr); if(!openALDevice) {     \/* fail *\/ }<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043b\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0432\u044b\u0448\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0438 \u0445\u043e\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u0431\u0440\u0430\u043b \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432 <code>alcOpenDevice<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>nullptr<\/code>. \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 <code>nullptr<\/code> \u043f\u0440\u0438\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 <em>\u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/em>. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0438\u043b\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u0438\u043b\u0438 <code>nullptr<\/code>, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430.<\/p>\n<p>  \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u043b\u0438 \u0432\u044b \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442, \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 \u0434\u043e\u0440\u043e\u0436\u043a\u0430\u0445. \u041d\u0435\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 = \u043d\u0435\u0442 OpenAL; \u043d\u0435\u0442 OpenAL = \u043d\u0435\u0442 \u0437\u0432\u0443\u043a\u0430; \u043d\u0435\u0442 \u0437\u0432\u0443\u043a\u0430 = \u043d\u0435\u0442 \u0438\u0433\u0440\u044b.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435, \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u2014 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0435\u0451 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c.<\/p>\n<pre><code class=\"cpp\">ALCboolean closed; if(!alcCall(alcCloseDevice, closed, openALDevice, openALDevice)) {     \/* do we care? *\/ }<\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c, \u0442\u043e \u043d\u0430\u043c \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0435 \u0432\u0430\u0436\u043d\u043e. \u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0432\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u044b, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043e\u043f\u044b\u0442\u0443, \u044d\u0442\u043e\u0442 \u0432\u044b\u0437\u043e\u0432 \u0442\u043e\u0436\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442. \u041d\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u0441\u0451 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0432\u044b\u0437\u043e\u0432\u0430 <code>alcCloseDevice<\/code>, \u0442\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u0431\u044b\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e, \u0438 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043f\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438, \u0442\u043e \u0432\u044b \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441 \u044d\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432\u044b \u0441 <code>alcCall<\/code> \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0434\u0432\u0435 \u043a\u043e\u043f\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u0422\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 \u043e\u0434\u043d\u0430 \u0435\u0439 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a, \u0430 \u0432\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  \u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u044f \u043c\u043e\u0433\u0443 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u043b\u0430 \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438; \u043d\u043e \u043c\u043d\u0435 \u043b\u0435\u043d\u0438\u0432\u043e \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c. \u041e\u0441\u0442\u0430\u0432\u043b\u044e \u044d\u0442\u043e \u0432\u0430\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f.<\/p>\n<h3>\u041d\u0430\u0448 ALCcontext<\/h3>\n<p>  \u0412\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u2014 \u044d\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442. \u041a\u0430\u043a \u0438 \u0440\u0430\u043d\u0435\u0435, \u043e\u043d \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0438\u0437 OpenGL. \u0412 \u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438, \u043d\u043e \u043d\u0430\u043c \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f. \u041a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438\u043c\u0435\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 <strong>listener<\/strong> \u0438 <strong>sources<\/strong>, \u0438 \u0438\u0445 \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u043c\u0438.<\/p>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0432 \u041f\u041e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0432\u0443\u043a\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u0438\u0433\u0440 \u0432 99.9% \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"cpp\">ALCcontext* openALContext; if(!alcCall(alcCreateContext, openALContext, openALDevice, openALDevice, nullptr) || !openALContext) {     std::cerr &lt;&lt; &quot;ERROR: Could not create audio context&quot; &lt;&lt; std::endl;     \/* probably exit program *\/ }<\/code><\/pre>\n<p>  \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c, \u0434\u043b\u044f \u043a\u0430\u043a\u043e\u0433\u043e <code>ALCdevice<\/code> \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442; \u0442\u0430\u043a\u0436\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u043d\u0443\u043b\u0451\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <code>ALCint<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442.<\/p>\n<p>  \u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u044f \u0434\u0430\u0436\u0435 \u043d\u0435 \u0437\u043d\u0430\u044e, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0433\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432. \u0412\u0430\u0448\u0430 \u0438\u0433\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438. \u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0438\u043c\u0435\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0435 \u043e\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u043e \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u0432\u0430\u0436\u043d\u043e. \u041d\u043e \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0432\u0430\u0436\u043d\u043e:<\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430<\/th>\n<th>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>ALC_FREQUENCY<\/code><\/td>\n<td>\u0427\u0430\u0441\u0442\u043e\u0442\u0430 \u043c\u0438\u043a\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0431\u0443\u0444\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430, \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u043c\u0430\u044f \u0432 \u0413\u0446<\/td>\n<\/tr>\n<tr>\n<td><code>ALC_REFRESH<\/code><\/td>\n<td>\u0418\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f, \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u043c\u044b\u0435 \u0432 \u0413\u0446<\/td>\n<\/tr>\n<tr>\n<td><code>ALC_SYNC<\/code><\/td>\n<td><code>0<\/code> \u0438\u043b\u0438 <code>1<\/code> \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442, \u0434\u043e\u043b\u0436\u0435\u043d \u043b\u0438 \u044d\u0442\u043e \u0431\u044b\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0438\u043b\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442<\/td>\n<\/tr>\n<tr>\n<td><code>ALC_MONO_SOURCES<\/code><\/td>\n<td>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0449\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043e\u043d\u043e\u0444\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d\u043e \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0435\u0448\u044c \u044d\u0442\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435.<\/td>\n<\/tr>\n<tr>\n<td><code>ALC_STEREO_SOURCES<\/code><\/td>\n<td>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0434\u043b\u044f \u0441\u0442\u0435\u0440\u0435\u043e\u0434\u0430\u043d\u043d\u044b\u0445.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0435 \u0432\u0430\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0438\u043b\u0438 \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430; \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 <code>ALC_INVALID_VALUE<\/code>. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u0442\u0435 \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443 <code>ALC_INVALID_DEVICE<\/code>, \u043d\u043e, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443 \u043c\u044b \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u041d\u0430\u043c \u0435\u0449\u0451 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u2014 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 Windows OpenGL Rendering Context, \u043f\u0440\u0430\u0432\u0434\u0430? \u042d\u0442\u043e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435.<\/p>\n<pre><code class=\"cpp\">ALCboolean contextMadeCurrent = false; if(!alcCall(alcMakeContextCurrent, contextMadeCurrent, openALDevice, openALContext)    || contextMadeCurrent != ALC_TRUE) {     std::cerr &lt;&lt; &quot;ERROR: Could not make audio context current&quot; &lt;&lt; std::endl;     \/* probably exit or give up on having sound *\/ }<\/code><\/pre>\n<p>  \u0414\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043b\u044e\u0431\u044b\u0445 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c (\u0438\u043b\u0438 \u0441 sources \u0438 listeners \u0432 \u043d\u0451\u043c). \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u0435\u0440\u043d\u0451\u0442 <code>true<\/code> \u0438\u043b\u0438 <code>false<\/code>, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0435 <code>alcGetError<\/code> \u2014 \u044d\u0442\u043e <code>ALC_INVALID_CONTEXT<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0432 \u0441 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u0442.\u0435. \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0431\u044b\u043b \u0442\u0435\u043a\u0443\u0449\u0438\u043c, \u0430 \u0437\u0430\u0442\u0435\u043c \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442\u044c \u0435\u0433\u043e.<\/p>\n<pre><code class=\"cpp\">if(!alcCall(alcMakeContextCurrent, contextMadeCurrent, openALDevice, nullptr)) {     \/* what can you do? *\/ }  if(!alcCall(alcDestroyContext, openALDevice, openALContext)) {     \/* not much you can do *\/ }<\/code><\/pre>\n<p>  \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043e\u0442 <code>alcDestroyContext<\/code> \u0442\u0430\u043a\u0430\u044f \u0436\u0435, \u043a\u0430\u043a \u0438 \u0443 <code>alcMakeContextCurrent<\/code> \u2014 <code>ALC_INVALID_CONTEXT<\/code>; \u0435\u0441\u043b\u0438 \u0432\u044b \u0432\u0441\u0451 \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0435\u0451, \u0430 \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435, \u0442\u043e \u0441 \u044d\u0442\u0438\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u043e\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<blockquote><p><strong>\u0417\u0430\u0447\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c?<\/strong><\/p>\n<p>  \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e \u043d\u0438\u0445 \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u0432 \u043f\u043e\u0442\u043e\u043a\u0435 \u043e\u0448\u0438\u0431\u043e\u043a, \u0447\u0442\u043e \u0434\u043b\u044f \u043d\u0430\u0441 \u0434\u0435\u043b\u0430\u0435\u0442 <code>alcCall<\/code>.\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043e\u043d \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u044b\u0434\u0430\u0451\u0442 \u043d\u0430\u043c \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0430 \u0447\u044c\u0451\u043c-\u0442\u043e \u0447\u0443\u0436\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438 <a href=\"https:\/\/github.com\/kcat\/openal-soft\/issues\" rel=\"nofollow\">\u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e \u0431\u0430\u0433\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c OpenAL Soft<\/a>.<\/p><\/blockquote>\n<p>  <\/p>\n<h2>\u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u043d\u0430\u0448 \u043f\u0435\u0440\u0432\u044b\u0439 \u0437\u0432\u0443\u043a<\/h2>\n<p>  \u041d\u0443, \u0445\u0432\u0430\u0442\u0438\u0442 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u0435\u043c \u0437\u0432\u0443\u043a. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u0444\u0430\u0439\u043b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u0442\u043e\u0442, \u0438\u0437 <a href=\"https:\/\/deckhead.itch.io\/the-last-boundary\" rel=\"nofollow\">\u0438\u0433\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u043a\u043e\u043d\u0447\u0443<\/a>.<\/p>\n<div class=\"oembed\"><a href=\"https:\/\/indiegamedev.net\/wp-content\/uploads\/2020\/02\/iamtheprotectorofthissystem.wav\">https:\/\/indiegamedev.net\/wp-content\/uploads\/2020\/02\/iamtheprotectorofthissystem.wav<\/a><\/div>\n<p>  <i>I am the protector of this system!<\/i><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043e\u0442\u043a\u0440\u043e\u0435\u043c IDE \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434. \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c OpenAL Soft \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u043a\u043e\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430 \u0438 \u043a\u043e\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<pre><code class=\"cpp\">int main() {     ALCdevice* openALDevice = alcOpenDevice(nullptr);     if(!openALDevice)         return 0;      ALCcontext* openALContext;     if(!alcCall(alcCreateContext, openALContext, openALDevice, openALDevice, nullptr) || !openALContext)     {         std::cerr &lt;&lt; &quot;ERROR: Could not create audio context&quot; &lt;&lt; std::endl;         return 0;     }     ALCboolean contextMadeCurrent = false;     if(!alcCall(alcMakeContextCurrent, contextMadeCurrent, openALDevice, openALContext)        || contextMadeCurrent != ALC_TRUE)     {         std::cerr &lt;&lt; &quot;ERROR: Could not make audio context current&quot; &lt;&lt; std::endl;         return 0;     }      std::uint8_t channels;     std::int32_t sampleRate;     std::uint8_t bitsPerSample;     std::vector&lt;char&gt; soundData;     if(!load_wav(&quot;iamtheprotectorofthissystem.wav&quot;, channels, sampleRate, bitsPerSample, soundData))     {         std::cerr &lt;&lt; &quot;ERROR: Could not load wav&quot; &lt;&lt; std::endl;         return 0;     }      ALuint buffer;     alCall(alGenBuffers, 1, &amp;buffer);      ALenum format;     if(channels == 1 &amp;&amp; bitsPerSample == 8)         format = AL_FORMAT_MONO8;     else if(channels == 1 &amp;&amp; bitsPerSample == 16)         format = AL_FORMAT_MONO16;     else if(channels == 2 &amp;&amp; bitsPerSample == 8)         format = AL_FORMAT_STEREO8;     else if(channels == 2 &amp;&amp; bitsPerSample == 16)         format = AL_FORMAT_STEREO16;     else     {         std::cerr             &lt;&lt; &quot;ERROR: unrecognised wave format: &quot;             &lt;&lt; channels &lt;&lt; &quot; channels, &quot;             &lt;&lt; bitsPerSample &lt;&lt; &quot; bps&quot; &lt;&lt; std::endl;         return 0;     }      alCall(alBufferData, buffer, format, soundData.data(), soundData.size(), sampleRate);     soundData.clear(); \/\/ erase the sound in RAM      ALuint source;     alCall(alGenSources, 1, &amp;source);     alCall(alSourcef, source, AL_PITCH, 1);     alCall(alSourcef, source, AL_GAIN, 1.0f);     alCall(alSource3f, source, AL_POSITION, 0, 0, 0);     alCall(alSource3f, source, AL_VELOCITY, 0, 0, 0);     alCall(alSourcei, source, AL_LOOPING, AL_FALSE);     alCall(alSourcei, source, AL_BUFFER, buffer);      alCall(alSourcePlay, source);      ALint state = AL_PLAYING;      while(state == AL_PLAYING)     {         alCall(alGetSourcei, source, AL_SOURCE_STATE, &amp;state);     }      alCall(alDeleteSources, 1, &amp;source);     alCall(alDeleteBuffers, 1, &amp;buffer);      alcCall(alcMakeContextCurrent, contextMadeCurrent, openALDevice, nullptr);     alcCall(alcDestroyContext, openALDevice, openALContext);      ALCboolean closed;     alcCall(alcCloseDevice, closed, openALDevice, openALDevice);      return 0; }<\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c! \u041a\u043e\u043c\u043f\u043e\u043d\u0443\u0435\u043c! \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c! <em><strong>I am the prrrootector of this system<\/strong><\/em>. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0441\u043b\u044b\u0448\u0438\u0442\u0435 \u0437\u0432\u0443\u043a\u0430, \u0442\u043e \u0441\u043d\u043e\u0432\u0430 \u0432\u0441\u0451 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435. \u0415\u0441\u043b\u0438 \u0432 \u043e\u043a\u043d\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e, \u0442\u043e \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u043f\u043e\u0442\u043e\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a, \u0438 \u043e\u043d \u0432\u0430\u0436\u0435\u043d. \u041d\u0430\u0448\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0432\u0448\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>  \u041d\u0430\u0439\u0434\u044f \u043e\u0448\u0438\u0431\u043a\u0443, \u0438\u0437\u0443\u0447\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/kcat\/openal-soft\/wiki\/Programmer%27s-Guide\" rel=\"nofollow\">Programmers Guide<\/a> \u0438 \u0432 <a href=\"https:\/\/openal.org\/documentation\/openal-1.1-specification.pdf\" rel=\"nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043f\u0440\u0438 \u043a\u0430\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u044d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u0434\u0430\u0441\u0442\u0441\u044f, \u0442\u043e \u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043f\u043e\u0434 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u043e\u043c \u0441\u0442\u0430\u0442\u044c\u0438, \u0438 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043f\u043e\u043c\u043e\u0447\u044c.<\/p>\n<h3>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 RIFF WAVE<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">std::uint8_t channels; std::int32_t sampleRate; std::uint8_t bitsPerSample; std::vector&lt;char&gt; soundData; if(!load_wav(&quot;iamtheprotectorofthissystem.wav&quot;, channels, sampleRate, bitsPerSample, soundData)) {     std::cerr &lt;&lt; &quot;ERROR: Could not load wav&quot; &lt;&lt; std::endl;     return 0; }<\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043a\u043e\u0434\u0443 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 wave. \u0412\u0430\u0436\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u0438\u043b\u0438 \u043a\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u0438\u043b\u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440: \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0430\u043d\u0430\u043b\u043e\u0432, \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0442\u043e\u0432 \u043d\u0430 \u0441\u044d\u043c\u043f\u043b.<\/p>\n<h3>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">ALuint buffer; alCall(alGenBuffers, 1, &amp;buffer);<\/code><\/pre>\n<p>  \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043b\u044f \u0432\u0430\u0441 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c, \u0435\u0441\u043b\u0438 \u0432\u044b \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0431\u0443\u0444\u0435\u0440\u044b \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 OpenGL. \u041f\u043e \u0441\u0443\u0442\u0438, \u043c\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0431\u0443\u0444\u0435\u0440 \u0438 \u043f\u0440\u0438\u0442\u0432\u043e\u0440\u044f\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u043a\u0430\u0440\u0442\u0435. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0436\u0435 \u0434\u0435\u043b\u0435 \u043e\u043d \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u041e\u0417\u0423, \u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f OpenAL \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0435 \u044d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>ALuint<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>\u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u043c<\/em> \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e <strong>buffer<\/strong> \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u043a\u0430\u0440\u0442\u044b. \u0423 \u043d\u0430\u0441 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0442 <em>\u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/em> \u043a \u044d\u0442\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0437\u0430\u0431\u0440\u0430\u043b\u0438 \u0438\u0445 \u0438\u0437 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u0438\u0437 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u041e\u0417\u0423) \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043b\u0438 \u0432 \u0437\u0432\u0443\u043a\u043e\u0432\u0443\u044e \u043a\u0430\u0440\u0442\u0443\/\u0447\u0438\u043f \u0438 \u0442.\u043f. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 OpenGL, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u044f \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u041e\u0417\u0423 \u0432\u043e VRAM.<\/p>\n<p>  \u042d\u0442\u043e\u0442 <em>\u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440<\/em> \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 <code>alGenBuffers<\/code>. \u041e\u043d \u0438\u043c\u0435\u0435\u0442 \u043f\u0430\u0440\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u0448\u0438\u0431\u043e\u043a, \u0441\u0430\u043c\u044b\u043c \u0432\u0430\u0436\u043d\u044b\u043c \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>AL_OUT_OF_MEMORY<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0437\u0432\u0443\u043a\u043e\u0432\u0443\u044e \u043a\u0430\u0440\u0442\u0443. \u0412\u044b \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 <em>\u044d\u0442\u043e\u0439<\/em> \u043e\u0448\u0438\u0431\u043a\u0438, \u0435\u0441\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440, \u043e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u044b <a href=\"https:\/\/indiegamedev.net\/2020\/01\/23\/game-engine-development-for-the-hobby-developer-part-3-audio\/\" rel=\"nofollow\">\u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0435 \u0434\u0432\u0438\u0436\u043e\u043a<\/a>.<\/p>\n<h3>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442 \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">ALenum format;  if(channels == 1 &amp;&amp; bitsPerSample == 8)     format = AL_FORMAT_MONO8; else if(channels == 1 &amp;&amp; bitsPerSample == 16)     format = AL_FORMAT_MONO16; else if(channels == 2 &amp;&amp; bitsPerSample == 8)     format = AL_FORMAT_STEREO8; else if(channels == 2 &amp;&amp; bitsPerSample == 16)     format = AL_FORMAT_STEREO16; else {     std::cerr         &lt;&lt; &quot;ERROR: unrecognised wave format: &quot;         &lt;&lt; channels &lt;&lt; &quot; channels, &quot;         &lt;&lt; bitsPerSample &lt;&lt; &quot; bps&quot; &lt;&lt; std::endl;     return 0; }<\/code><\/pre>\n<p>  \u0417\u0432\u0443\u043a\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0442\u0430\u043a: \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <em>\u043a\u0430\u043d\u0430\u043b\u043e\u0432<\/em> \u0438 \u0435\u0441\u0442\u044c \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 <em>\u0431\u0438\u0442\u043e\u0432 \u043d\u0430 \u0441\u044d\u043c\u043f\u043b<\/em>. \u0414\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 <em>\u0441\u044d\u043c\u043f\u043b\u043e\u0432<\/em>.<\/p>\n<p>  \u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 <em>\u0441\u044d\u043c\u043f\u043b\u043e\u0432<\/em> \u0432 \u0430\u0443\u0434\u0438\u043e\u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"cpp\">std::int_fast32_t numberOfSamples = dataSize \/ (numberOfChannels * (bitsPerSample \/ 8));<\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 <em>\u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/em> \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"cpp\">std::size_t duration = numberOfSamples \/ sampleRate;<\/code><\/pre>\n<p>  \u041d\u043e \u043f\u043e\u043a\u0430 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u043d\u0438 <code>numberOfSamples<\/code>, \u043d\u0438 <code>duration<\/code>, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u0430\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u044d\u0442\u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a <code>format<\/code> \u2014 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c OpenAL \u0444\u043e\u0440\u043c\u0430\u0442 \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c, \u043f\u0440\u0430\u0432\u0434\u0430? \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u043c\u044b \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0431\u0443\u0444\u0435\u0440 \u0442\u0435\u043a\u0441\u0442\u0443\u0440 OpenGL, \u0441\u043e\u043e\u0431\u0449\u0430\u044f, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 BGRA \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0438\u0437 8-\u0431\u0438\u0442\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0438 \u0432 OpenAL.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c OpenAL \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u0437\u0436\u0435, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u0434 <em>\u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c<\/em> \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e, \u043a\u0430\u043a \u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 OpenAL. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0441\u0435\u0433\u043e \u0447\u0435\u0442\u044b\u0440\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u0430\u043d\u0430\u043b\u043e\u0432: \u043e\u0434\u0438\u043d \u0434\u043b\u044f \u043c\u043e\u043d\u043e, \u0434\u0432\u0430 \u0434\u043b\u044f \u0441\u0442\u0435\u0440\u0435\u043e.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u0430\u043d\u0430\u043b\u043e\u0432, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0442\u043e\u0432 \u043d\u0430 \u0441\u044d\u043c\u043f\u043b. \u041e\u043d\u043e \u0440\u0430\u0432\u043d\u043e \u0438\u043b\u0438 <code>8<\/code>, \u0438\u043b\u0438 <code>16<\/code>, \u0438 \u043f\u043e \u0441\u0443\u0442\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0437\u0432\u0443\u043a\u0430.<\/p>\n<p>  \u0422\u0430\u043a \u0447\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u0438 \u0431\u0438\u0442\u043e\u0432 \u043d\u0430 \u0441\u044d\u043c\u043f\u043b, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u043c \u0441\u043e\u043e\u0431\u0449\u0438\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 wave, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 <code>ALenum<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <code>format<\/code>.<\/p>\n<h3>\u0417\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">alCall(alBufferData, buffer, format, soundData.data(), soundData.size(), sampleRate); soundData.clear(); \/\/ erase the sound in RAM<\/code><\/pre>\n<p>  \u0421 \u044d\u0442\u0438\u043c \u0432\u0441\u0451 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e. \u041c\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0432 OpenAL Buffer, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 <em>\u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440<\/em> <code>buffer<\/code>; \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 ptr <code>soundData.data()<\/code>, \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 <code>size<\/code> \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 <code>sampleRate<\/code>. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u043c OpenAL \u0444\u043e\u0440\u043c\u0430\u0442 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>format<\/code>.<\/p>\n<p>  \u0412 \u043a\u043e\u043d\u0446\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a wave. \u0417\u0430\u0447\u0435\u043c \u0436\u0435? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0443\u0436\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0438\u0445 \u0432 \u0437\u0432\u0443\u043a\u043e\u0432\u0443\u044e \u043a\u0430\u0440\u0442\u0443. \u041d\u0430\u043c \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0445 \u0432 \u0434\u0432\u0443\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0438 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0430\u0433\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b. \u0415\u0441\u043b\u0438 \u0437\u0432\u0443\u043a\u043e\u0432\u0430\u044f \u043a\u0430\u0440\u0442\u0430 \u043f\u043e\u0442\u0435\u0440\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0442\u043e \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0438\u0445 \u0441 \u0434\u0438\u0441\u043a\u0430 \u0438 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0434\u043b\u044f \u0426\u041f \u0438\u043b\u0438 \u0435\u0449\u0451 \u043a\u043e\u0433\u043e-\u0442\u043e.<\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Source<\/h3>\n<p>  \u0412\u0441\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e OpenAL \u043f\u043e \u0441\u0443\u0442\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>listener<\/strong>, \u0441\u043b\u0443\u0448\u0430\u044e\u0449\u0438\u043c \u0437\u0432\u0443\u043a\u0438, \u0438\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u043e\u0434\u043d\u0438\u043c \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 <strong>sources<\/strong>. \u041d\u0443, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0437\u0432\u0443\u043a\u0430.<\/p>\n<pre><code class=\"cpp\">ALuint source; alCall(alGenSources, 1, &amp;source); alCall(alSourcef, source, AL_PITCH, 1); alCall(alSourcef, source, AL_GAIN, 1.0f); alCall(alSource3f, source, AL_POSITION, 0, 0, 0); alCall(alSource3f, source, AL_VELOCITY, 0, 0, 0); alCall(alSourcei, source, AL_LOOPING, AL_FALSE); alCall(alSourcei, source, AL_BUFFER, buffer);<\/code><\/pre>\n<p>  \u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u043f\u043e\u043b\u043d\u0435 \u043d\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442. \u041d\u043e \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0434\u0435\u043b\u0430\u044e\u0442 (\u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u0445\u0438\u0442\u0440\u043e \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c).<\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c source \u2014 \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u044d\u0442\u043e \u0441\u043d\u043e\u0432\u0430 <em>\u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440<\/em> \u0447\u0435\u0433\u043e-\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 OpenAL API. \u041c\u044b \u0437\u0430\u0434\u0430\u0451\u043c pitch (\u0442\u043e\u043d) \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f, gain (\u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c) \u0434\u0435\u043b\u0430\u0435\u043c \u0440\u0430\u0432\u043d\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c; \u043c\u044b <i>\u043d\u0435 \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u0432\u0430\u0435\u043c<\/i> \u0437\u0432\u0443\u043a, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0448\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f, \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0431\u0443\u0444\u0435\u0440.<\/p>\n<p>  \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0431\u0443\u0444\u0435\u0440. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0440\u0430\u0433\u0438, \u0441\u0442\u0440\u0435\u043b\u044f\u044e\u0449\u0438\u0435 \u0432 \u0438\u0433\u0440\u043e\u043a\u0430 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0441\u0442, \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0437\u0432\u0443\u043a \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043f\u0438\u0439 \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u0442 \u0432 3D-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0437\u0432\u0443\u043a.<\/p>\n<h3>\u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0437\u0432\u0443\u043a\u0430<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">alCall(alSourcePlay, source);  ALint state = AL_PLAYING;  while(state == AL_PLAYING) {     alCall(alGetSourcei, source, AL_SOURCE_STATE, &amp;state); }<\/code><\/pre>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 source. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c <code>alSourcePlay<\/code>.<\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f <code>AL_SOURCE_STATE<\/code> \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0438 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0435\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c. \u041a\u043e\u0433\u0434\u0430 \u043e\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e <code>AL_PLAYING<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c. \u041c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0430 <code>AL_STOPPED<\/code>, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442 \u0438\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0432\u0443\u043a \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430 (\u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430). \u0415\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u0434\u043b\u044f looping \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>true<\/code>, \u0442\u043e \u0437\u0432\u0443\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432\u0435\u0447\u043d\u043e.<\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0431\u0443\u0444\u0435\u0440 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0437\u0432\u0443\u043a. \u0418\u043b\u0438 \u0437\u0430\u043d\u043e\u0432\u043e \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u0437\u0432\u0443\u043a, \u0438 \u0442.\u0434. \u041f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0434\u0430\u0451\u043c \u0431\u0443\u0444\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>alSourcePlay<\/code> \u0438, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, <code>alSourceStop<\/code>, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e.<\/p>\n<h3>\u041e\u0447\u0438\u0441\u0442\u043a\u0430<\/h3>\n<p>  <\/p>\n<pre><code class=\"cpp\">alCall(alDeleteSources, 1, &amp;source); alCall(alDeleteBuffers, 1, &amp;buffer);<\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u044b\u0445\u043e\u0434, \u0442\u043e \u0443\u0434\u0430\u043b\u0438\u043c \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 source \u0438 buffer.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u0430 \u0431\u0435\u0437 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0439.<\/p>\n<h2>\u041a\u0443\u0434\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435?<\/h2>\n<p>  \u0417\u043d\u0430\u044f \u0432\u0441\u0451 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0438\u0433\u0440\u0443! <a href=\"https:\/\/indiegamedev.net\/2020\/02\/09\/making-your-first-game-pong-the-architecture\/\" rel=\"nofollow\">\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c Pong<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/indiegamedev.net\/2020\/01\/21\/5-games-for-hobby-developers-to-make\/\" rel=\"nofollow\">\u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0443\u0433\u0443\u044e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0438\u0433\u0440\u0443<\/a>, \u0434\u043b\u044f \u043d\u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u041d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u0435! \u042d\u0442\u0438 \u0431\u0443\u0444\u0435\u0440\u044b \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0445 \u0437\u0432\u0443\u043a\u043e\u0432, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u043c\u0443\u0437\u044b\u043a\u0430 \u0438\u043b\u0438 \u043e\u0437\u0432\u0443\u0447\u043a\u0430, \u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u0430\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0430\u0443\u0434\u0438\u043e\u0434\u0430\u043d\u043d\u044b\u0445 \u0432 OpenAL. \u041e\u0431 \u044d\u0442\u043e\u043c \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0441\u0435\u0440\u0438\u0438 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u043e\u0432.<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/488744\/\"> https:\/\/habr.com\/ru\/post\/488744\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/488744\/\">\u0412\u0430\u0448\u0435\u0439 \u0438\u0433\u0440\u0435 \u043d\u0443\u0436\u0435\u043d \u0437\u0432\u0443\u043a! \u041d\u0430\u0432\u0435\u0440\u043d\u043e, \u0432\u044b \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 OpenGL \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435. \u0412\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u0435\u0433\u043e API, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0438\u0441\u044c \u043a <a href=\"https:\/\/en.wikipedia.org\/wiki\/OpenAL\" rel=\"nofollow\">OpenAL<\/a>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c.<\/p>\n<p>  \u0427\u0442\u043e \u0436\u0435, \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u2014 OpenAL \u0442\u043e\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 API. \u041e\u043d \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u0438\u043c\u0438\u0442\u0430\u0446\u0438\u0438 API \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenGL. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u0435\u0433\u043e \u0441\u0440\u0435\u0434\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0434\u043b\u044f \u0438\u0433\u0440; \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043e\u043d \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f OpenAL \u0432 \u0438\u0433\u0440\u0435, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 C++. \u041c\u044b \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u0437\u0432\u0443\u043a\u0438, \u043c\u0443\u0437\u044b\u043a\u0443 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0432\u0443\u043a\u0430 \u0432 3D-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<h2>\u0418\u0441\u0442\u043e\u0440\u0438\u044f OpenAL<\/h2>\n<p>  \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0431\u044b\u0442\u044c \u043a\u0440\u0430\u0442\u043a\u0438\u043c. \u041a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u043e\u0441\u044c \u0432\u044b\u0448\u0435, \u043e\u043d \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f \u043a\u0430\u043a \u0438\u043c\u0438\u0442\u0430\u0446\u0438\u044f OpenGL API, \u0438 \u043d\u0430 \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u0430. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0439 API, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043d\u043e\u0433\u0438\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d, \u0438 \u0435\u0441\u043b\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u2014 \u043e\u0434\u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0430 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430, \u0442\u043e \u0437\u0432\u0443\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e OpenAL \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0441\u0442\u0430\u0442\u044c open-source, \u043d\u043e \u043f\u043e\u0442\u043e\u043c \u043a\u043e\u0435-\u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e\u2026<\/p>\n<p>  \u041b\u044e\u0434\u0435\u0439 \u043d\u0435 \u0442\u0430\u043a \u0441\u0438\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0437\u0432\u0443\u043a, \u043a\u0430\u043a \u0433\u0440\u0430\u0444\u0438\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 Creative \u0441\u0434\u0435\u043b\u0430\u043b\u0430 OpenAL \u0441\u0432\u043e\u0435\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e, \u0430 <em>\u044d\u0442\u0430\u043b\u043e\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/em> \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u043f\u0440\u0438\u0435\u0442\u0430\u0440\u043d\u0430 \u0438 \u043d\u0435\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430. \u041d\u043e! <em>\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f<\/em> OpenAL \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u00ab\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c\u00bb \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u043e\u043d\u0430 <a href=\"https:\/\/openal.org\/documentation\/openal-1.1-specification.pdf\" rel=\"nofollow\">\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442\u0441\u044f<\/a>.<\/p>\n<p>  \u0412\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0432\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043d\u043e \u0438\u0445 \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e. \u0417\u0432\u0443\u043a \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e, \u043a\u0430\u043a \u0433\u0440\u0430\u0444\u0438\u043a\u0430, \u0432\u0435\u0434\u044c \u043e\u0441\u043e\u0431\u043e\u0439 \u043d\u0443\u0436\u0434\u044b \u043a \u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u0442.<\/p>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0442\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u0430 \u0434\u0440\u0443\u0433\u0438\u043c \u043b\u044e\u0434\u044f\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c open-source-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/kcat\/openal-soft\" rel=\"nofollow\">OpenAL Soft<\/a>, \u0438, \u0447\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430 \u0438\u0441\u043a\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435. \u042d\u0442\u043e \u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044f, \u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0436\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-299148","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299148","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=299148"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299148\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=299148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=299148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=299148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}