{"action":"created","comment":{"url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/pulls/comments/201917159","pull_request_review_id":136511269,"id":201917159,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTkxNzE1OQ==","diff_hunk":"@@ -22,43 +22,48 @@ public AudioBuffer()\n         public AudioBuffer(WavFile wavFile) : this()\n         {\n             int format = 0;\n-\n-            switch (wavFile.Channels)\n+            if ((AudioFormatType) wavFile.AudioFormat != AudioFormatType.Microsoft)","path":"src/OpenSage.Game/Audio/AudioBuffer.cs","position":null,"original_position":6,"commit_id":"3b8be5a4fa2cebecb7057e307118934d6c6fcc29","original_commit_id":"f9753639e6c81a1bdbc5c4c816c40790504f183c","user":{"login":"hashkitten","id":10756469,"node_id":"MDQ6VXNlcjEwNzU2NDY5","avatar_url":"https://avatars1.githubusercontent.com/u/10756469?v=4","gravatar_id":"","url":"https://api.github.com/users/hashkitten","html_url":"https://github.com/hashkitten","followers_url":"https://api.github.com/users/hashkitten/followers","following_url":"https://api.github.com/users/hashkitten/following{/other_user}","gists_url":"https://api.github.com/users/hashkitten/gists{/gist_id}","starred_url":"https://api.github.com/users/hashkitten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashkitten/subscriptions","organizations_url":"https://api.github.com/users/hashkitten/orgs","repos_url":"https://api.github.com/users/hashkitten/repos","events_url":"https://api.github.com/users/hashkitten/events{/privacy}","received_events_url":"https://api.github.com/users/hashkitten/received_events","type":"User","site_admin":false},"body":"Unfortunately BitsPerSample represents the compressed bits per sample, not the uncompressed bits per sample, so for ADPCM it is 4. But you're right, it's probably not the right place to put this code, so I have opted to make BitsPerSample a method that returns the 'true' uncompressed bits per sample rather than polluting AudioBuffer.","created_at":"2018-07-12T05:58:29Z","updated_at":"2018-07-12T05:58:29Z","html_url":"https://github.com/OpenSAGE/OpenSAGE/pull/133#discussion_r201917159","pull_request_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/pulls/133","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/OpenSAGE/OpenSAGE/pulls/comments/201917159"},"html":{"href":"https://github.com/OpenSAGE/OpenSAGE/pull/133#discussion_r201917159"},"pull_request":{"href":"https://api.github.com/repos/OpenSAGE/OpenSAGE/pulls/133"}},"in_reply_to_id":201833843},"pull_request":{"url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/pulls/133","id":200680850,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwNjgwODUw","html_url":"https://github.com/OpenSAGE/OpenSAGE/pull/133","diff_url":"https://github.com/OpenSAGE/OpenSAGE/pull/133.diff","patch_url":"https://github.com/OpenSAGE/OpenSAGE/pull/133.patch","issue_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/issues/133","number":133,"state":"open","locked":false,"title":"Support for mono DVI ADPCM compressed .wav files","user":{"login":"hashkitten","id":10756469,"node_id":"MDQ6VXNlcjEwNzU2NDY5","avatar_url":"https://avatars1.githubusercontent.com/u/10756469?v=4","gravatar_id":"","url":"https://api.github.com/users/hashkitten","html_url":"https://github.com/hashkitten","followers_url":"https://api.github.com/users/hashkitten/followers","following_url":"https://api.github.com/users/hashkitten/following{/other_user}","gists_url":"https://api.github.com/users/hashkitten/gists{/gist_id}","starred_url":"https://api.github.com/users/hashkitten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashkitten/subscriptions","organizations_url":"https://api.github.com/users/hashkitten/orgs","repos_url":"https://api.github.com/users/hashkitten/repos","events_url":"https://api.github.com/users/hashkitten/events{/privacy}","received_events_url":"https://api.github.com/users/hashkitten/received_events","type":"User","site_admin":false},"body":"Some C&C Generals sounds are stored in a compressed format known as DVI (or IMA) ADPCM. One such example is `Data\\Audio\\Sounds\\ctrustaa.wav`, which would previously cause a crash in the viewer when played. Since OpenAL does not support the format, we implement an on-the-fly decoder to unpack the compression into a linear PCM format that OpenAL can play. Note this commit only supports single channel files of this type, although supporting multiple channels should not be too hard (I haven't found any of these types of sounds yet though).\r\n\r\nUses\r\nhttps://icculus.org/SDL_sound/downloads/external_documentation/wavecomp.htm\r\nhttps://wiki.multimedia.cx/index.php/IMA_ADPCM\r\nas references.","created_at":"2018-07-11T12:18:28Z","updated_at":"2018-07-12T05:58:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76e7c5bb3e104471f131ed712e2737cf3b8b9253","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/pulls/133/commits","review_comments_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/pulls/133/comments","review_comment_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/issues/133/comments","statuses_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/statuses/3b8be5a4fa2cebecb7057e307118934d6c6fcc29","head":{"label":"hashkitten:master","ref":"master","sha":"3b8be5a4fa2cebecb7057e307118934d6c6fcc29","user":{"login":"hashkitten","id":10756469,"node_id":"MDQ6VXNlcjEwNzU2NDY5","avatar_url":"https://avatars1.githubusercontent.com/u/10756469?v=4","gravatar_id":"","url":"https://api.github.com/users/hashkitten","html_url":"https://github.com/hashkitten","followers_url":"https://api.github.com/users/hashkitten/followers","following_url":"https://api.github.com/users/hashkitten/following{/other_user}","gists_url":"https://api.github.com/users/hashkitten/gists{/gist_id}","starred_url":"https://api.github.com/users/hashkitten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashkitten/subscriptions","organizations_url":"https://api.github.com/users/hashkitten/orgs","repos_url":"https://api.github.com/users/hashkitten/repos","events_url":"https://api.github.com/users/hashkitten/events{/privacy}","received_events_url":"https://api.github.com/users/hashkitten/received_events","type":"User","site_admin":false},"repo":{"id":140233077,"node_id":"MDEwOlJlcG9zaXRvcnkxNDAyMzMwNzc=","name":"OpenSAGE","full_name":"hashkitten/OpenSAGE","owner":{"login":"hashkitten","id":10756469,"node_id":"MDQ6VXNlcjEwNzU2NDY5","avatar_url":"https://avatars1.githubusercontent.com/u/10756469?v=4","gravatar_id":"","url":"https://api.github.com/users/hashkitten","html_url":"https://github.com/hashkitten","followers_url":"https://api.github.com/users/hashkitten/followers","following_url":"https://api.github.com/users/hashkitten/following{/other_user}","gists_url":"https://api.github.com/users/hashkitten/gists{/gist_id}","starred_url":"https://api.github.com/users/hashkitten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashkitten/subscriptions","organizations_url":"https://api.github.com/users/hashkitten/orgs","repos_url":"https://api.github.com/users/hashkitten/repos","events_url":"https://api.github.com/users/hashkitten/events{/privacy}","received_events_url":"https://api.github.com/users/hashkitten/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hashkitten/OpenSAGE","description":"OpenSAGE is a free, open source re-implementation of SAGE, the 3D real time strategy (RTS) engine used in Command & Conquer: Generals and other RTS titles from EA Pacific. Written in C#. Not affiliated with EA.","fork":true,"url":"https://api.github.com/repos/hashkitten/OpenSAGE","forks_url":"https://api.github.com/repos/hashkitten/OpenSAGE/forks","keys_url":"https://api.github.com/repos/hashkitten/OpenSAGE/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashkitten/OpenSAGE/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashkitten/OpenSAGE/teams","hooks_url":"https://api.github.com/repos/hashkitten/OpenSAGE/hooks","issue_events_url":"https://api.github.com/repos/hashkitten/OpenSAGE/issues/events{/number}","events_url":"https://api.github.com/repos/hashkitten/OpenSAGE/events","assignees_url":"https://api.github.com/repos/hashkitten/OpenSAGE/assignees{/user}","branches_url":"https://api.github.com/repos/hashkitten/OpenSAGE/branches{/branch}","tags_url":"https://api.github.com/repos/hashkitten/OpenSAGE/tags","blobs_url":"https://api.github.com/repos/hashkitten/OpenSAGE/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashkitten/OpenSAGE/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashkitten/OpenSAGE/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashkitten/OpenSAGE/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashkitten/OpenSAGE/statuses/{sha}","languages_url":"https://api.github.com/repos/hashkitten/OpenSAGE/languages","stargazers_url":"https://api.github.com/repos/hashkitten/OpenSAGE/stargazers","contributors_url":"https://api.github.com/repos/hashkitten/OpenSAGE/contributors","subscribers_url":"https://api.github.com/repos/hashkitten/OpenSAGE/subscribers","subscription_url":"https://api.github.com/repos/hashkitten/OpenSAGE/subscription","commits_url":"https://api.github.com/repos/hashkitten/OpenSAGE/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashkitten/OpenSAGE/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashkitten/OpenSAGE/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashkitten/OpenSAGE/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashkitten/OpenSAGE/contents/{+path}","compare_url":"https://api.github.com/repos/hashkitten/OpenSAGE/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashkitten/OpenSAGE/merges","archive_url":"https://api.github.com/repos/hashkitten/OpenSAGE/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashkitten/OpenSAGE/downloads","issues_url":"https://api.github.com/repos/hashkitten/OpenSAGE/issues{/number}","pulls_url":"https://api.github.com/repos/hashkitten/OpenSAGE/pulls{/number}","milestones_url":"https://api.github.com/repos/hashkitten/OpenSAGE/milestones{/number}","notifications_url":"https://api.github.com/repos/hashkitten/OpenSAGE/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashkitten/OpenSAGE/labels{/name}","releases_url":"https://api.github.com/repos/hashkitten/OpenSAGE/releases{/id}","deployments_url":"https://api.github.com/repos/hashkitten/OpenSAGE/deployments","created_at":"2018-07-09T04:55:48Z","updated_at":"2018-07-12T05:55:52Z","pushed_at":"2018-07-12T05:55:50Z","git_url":"git://github.com/hashkitten/OpenSAGE.git","ssh_url":"git@github.com:hashkitten/OpenSAGE.git","clone_url":"https://github.com/hashkitten/OpenSAGE.git","svn_url":"https://github.com/hashkitten/OpenSAGE","homepage":"http://timjones.io/blog/tags/opensage/","size":18538,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OpenSAGE:master","ref":"master","sha":"f502535ce8221b77a98cf59957f217b0d77e970c","user":{"login":"OpenSAGE","id":10568284,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTY4Mjg0","avatar_url":"https://avatars0.githubusercontent.com/u/10568284?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenSAGE","html_url":"https://github.com/OpenSAGE","followers_url":"https://api.github.com/users/OpenSAGE/followers","following_url":"https://api.github.com/users/OpenSAGE/following{/other_user}","gists_url":"https://api.github.com/users/OpenSAGE/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSAGE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSAGE/subscriptions","organizations_url":"https://api.github.com/users/OpenSAGE/orgs","repos_url":"https://api.github.com/users/OpenSAGE/repos","events_url":"https://api.github.com/users/OpenSAGE/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSAGE/received_events","type":"Organization","site_admin":false},"repo":{"id":94316145,"node_id":"MDEwOlJlcG9zaXRvcnk5NDMxNjE0NQ==","name":"OpenSAGE","full_name":"OpenSAGE/OpenSAGE","owner":{"login":"OpenSAGE","id":10568284,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTY4Mjg0","avatar_url":"https://avatars0.githubusercontent.com/u/10568284?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenSAGE","html_url":"https://github.com/OpenSAGE","followers_url":"https://api.github.com/users/OpenSAGE/followers","following_url":"https://api.github.com/users/OpenSAGE/following{/other_user}","gists_url":"https://api.github.com/users/OpenSAGE/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSAGE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSAGE/subscriptions","organizations_url":"https://api.github.com/users/OpenSAGE/orgs","repos_url":"https://api.github.com/users/OpenSAGE/repos","events_url":"https://api.github.com/users/OpenSAGE/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSAGE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenSAGE/OpenSAGE","description":"OpenSAGE is a free, open source re-implementation of SAGE, the 3D real time strategy (RTS) engine used in Command & Conquer: Generals and other RTS titles from EA Pacific. Written in C#. Not affiliated with EA.","fork":false,"url":"https://api.github.com/repos/OpenSAGE/OpenSAGE","forks_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/forks","keys_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/teams","hooks_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/hooks","issue_events_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/issues/events{/number}","events_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/events","assignees_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/assignees{/user}","branches_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/branches{/branch}","tags_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/tags","blobs_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/languages","stargazers_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/stargazers","contributors_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/contributors","subscribers_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/subscribers","subscription_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/subscription","commits_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/contents/{+path}","compare_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/merges","archive_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/downloads","issues_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/issues{/number}","pulls_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/labels{/name}","releases_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/releases{/id}","deployments_url":"https://api.github.com/repos/OpenSAGE/OpenSAGE/deployments","created_at":"2017-06-14T09:53:41Z","updated_at":"2018-07-11T09:40:00Z","pushed_at":"2018-07-12T05:55:51Z","git_url":"git://github.com/OpenSAGE/OpenSAGE.git","ssh_url":"git@github.com:OpenSAGE/OpenSAGE.git","clone_url":"https://github.com/OpenSAGE/OpenSAGE.git","svn_url":"https://github.com/OpenSAGE/OpenSAGE","homepage":"http://timjones.io/blog/tags/opensage/","size":18530,"stargazers_count":167,"watchers_count":167,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":20,"open_issues":19,"watchers":167,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenSAGE/OpenSAGE/pulls/133"},"html":{"href":"https://github.com/OpenSAGE/OpenSAGE/pull/133"},"issue":{"href":"https://api.github.com/repos/OpenSAGE/OpenSAGE/issues/133"},"comments":{"href":"https://api.github.com/repos/OpenSAGE/OpenSAGE/issues/133/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenSAGE/OpenSAGE/pulls/133/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenSAGE/OpenSAGE/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenSAGE/OpenSAGE/pulls/133/commits"},"statuses":{"href":"https://api.github.com/repos/OpenSAGE/OpenSAGE/statuses/3b8be5a4fa2cebecb7057e307118934d6c6fcc29"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"hashkitten"}}