{"action":"created","comment":{"url":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/comments/47612884","id":47612884,"diff_hunk":"@@ -265,69 +254,9 @@ AudioManager.prototype.freeSound = function (sound) {\n  * @param {number} [pitch]   - optional pitch, in semi-tone\n  */\n AudioManager.prototype.playLoopSound = function (channelId, soundId, volume, pan, pitch) {\n-\tvar defaultFade    = this.settings.defaultFade;\n-\tvar crossFading    = this.settings.crossFading;\n-\tvar channel        = this.channels[channelId];\n-\tvar currentSound   = channel.loopSound;\n-\tvar currentSoundId = currentSound && currentSound.id;\n-\n-\tvolume = Math.max(0, Math.min(1, volume || 1));\n-\n-\tchannel.loopId  = soundId;\n-\tchannel.loopVol = volume;\n-\n-\t// don't load or play sound if channel is mutted\n-\tif (channel.muted) return;\n-\n-\t// if requested sound is already playing, update volume, pan and pitch\n-\tif (soundId === currentSoundId && currentSound && (currentSound.playing || currentSound.stopping)) {\n-\t\tcurrentSound.play(volume * channel.volume, pan, pitch);\n-\t\tif (channel.nextLoop) {\n-\t\t\tchannel.nextLoop.cancelOnLoadCallbacks();\n-\t\t\tchannel.nextLoop = null;\n-\t\t}\n-\t\treturn;\n-\t}\n-\n-\t// check if requested sound is already scheduled to play next\n-\tif (channel.nextLoop && channel.nextLoop.id === soundId) return;\n-\n-\tvar self = this;\n-\n-\tfunction stopCurrentLoop(sound, cb) {\n-\t\tif (!sound) return cb && cb();\n-\t\tif (sound.stopping) return; // callback is already scheduled\n-\t\tsound.stop(function () {\n-\t\t\tself.freeSound(sound); // TODO: add an option to keep file in memory\n-\t\t\treturn cb && cb();\n-\t\t});\n-\t}\n-\n-\tfunction playNextSound() {\n-\t\tvar sound = channel.loopSound = channel.nextLoop;\n-\t\tchannel.nextLoop = null;\n-\t\tif (!sound) return;\n-\t\tsound.setLoop(true);\n-\t\tsound.fade = defaultFade;\n-\t\tsound.play(volume * channel.volume, pan, pitch); // load and play\n-\t}\n-\n-\tif (crossFading) {\n-\t\tif (channel.nextLoop) {\n-\t\t\t// if another nextSound already loading, cancel previous callback\n-\t\t\tchannel.nextLoop.cancelOnLoadCallbacks();\n-\t\t}\n-\t\tchannel.nextLoop = this.createSound(soundId);\n-\t\tchannel.nextLoop.load(function onSoundLoad(error) {\n-\t\t\tif (error) return;\n-\t\t\tstopCurrentLoop(channel.loopSound);\n-\t\t\tplayNextSound();\n-\t\t});\n-\n-\t} else {\n-\t\tchannel.nextLoop = this.createSound(soundId);\n-\t\tstopCurrentLoop(channel.loopSound, playNextSound);\n-\t}","path":"index.js","position":155,"original_position":155,"commit_id":"f6e40e29cf497c54057296e0522e22f45c75bcb7","original_commit_id":"f6e40e29cf497c54057296e0522e22f45c75bcb7","user":{"login":"cstoquer","id":2462139,"avatar_url":"https://avatars.githubusercontent.com/u/2462139?v=3","gravatar_id":"","url":"https://api.github.com/users/cstoquer","html_url":"https://github.com/cstoquer","followers_url":"https://api.github.com/users/cstoquer/followers","following_url":"https://api.github.com/users/cstoquer/following{/other_user}","gists_url":"https://api.github.com/users/cstoquer/gists{/gist_id}","starred_url":"https://api.github.com/users/cstoquer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstoquer/subscriptions","organizations_url":"https://api.github.com/users/cstoquer/orgs","repos_url":"https://api.github.com/users/cstoquer/repos","events_url":"https://api.github.com/users/cstoquer/events{/privacy}","received_events_url":"https://api.github.com/users/cstoquer/received_events","type":"User","site_admin":false},"body":"all this code moved to `AudioChannel`","created_at":"2015-12-15T09:18:31Z","updated_at":"2015-12-15T09:18:31Z","html_url":"https://github.com/Wizcorp/AudioManager/pull/12#discussion_r47612884","pull_request_url":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/comments/47612884"},"html":{"href":"https://github.com/Wizcorp/AudioManager/pull/12#discussion_r47612884"},"pull_request":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/12","id":53081654,"html_url":"https://github.com/Wizcorp/AudioManager/pull/12","diff_url":"https://github.com/Wizcorp/AudioManager/pull/12.diff","patch_url":"https://github.com/Wizcorp/AudioManager/pull/12.patch","issue_url":"https://api.github.com/repos/Wizcorp/AudioManager/issues/12","number":12,"state":"open","locked":false,"title":"All mute feature","user":{"login":"cstoquer","id":2462139,"avatar_url":"https://avatars.githubusercontent.com/u/2462139?v=3","gravatar_id":"","url":"https://api.github.com/users/cstoquer","html_url":"https://github.com/cstoquer","followers_url":"https://api.github.com/users/cstoquer/followers","following_url":"https://api.github.com/users/cstoquer/following{/other_user}","gists_url":"https://api.github.com/users/cstoquer/gists{/gist_id}","starred_url":"https://api.github.com/users/cstoquer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstoquer/subscriptions","organizations_url":"https://api.github.com/users/cstoquer/orgs","repos_url":"https://api.github.com/users/cstoquer/repos","events_url":"https://api.github.com/users/cstoquer/events{/privacy}","received_events_url":"https://api.github.com/users/cstoquer/received_events","type":"User","site_admin":false},"body":"`AudioManager.allMute` let you mute / unmute all channels at once.\r\n","created_at":"2015-12-09T06:29:49Z","updated_at":"2015-12-15T09:18:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a2a68ff49a53e445214a5930be21424f8fa3646","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/12/commits","review_comments_url":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/12/comments","review_comment_url":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wizcorp/AudioManager/issues/12/comments","statuses_url":"https://api.github.com/repos/Wizcorp/AudioManager/statuses/f6e40e29cf497c54057296e0522e22f45c75bcb7","head":{"label":"cstoquer:feature/allMute","ref":"feature/allMute","sha":"f6e40e29cf497c54057296e0522e22f45c75bcb7","user":{"login":"cstoquer","id":2462139,"avatar_url":"https://avatars.githubusercontent.com/u/2462139?v=3","gravatar_id":"","url":"https://api.github.com/users/cstoquer","html_url":"https://github.com/cstoquer","followers_url":"https://api.github.com/users/cstoquer/followers","following_url":"https://api.github.com/users/cstoquer/following{/other_user}","gists_url":"https://api.github.com/users/cstoquer/gists{/gist_id}","starred_url":"https://api.github.com/users/cstoquer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstoquer/subscriptions","organizations_url":"https://api.github.com/users/cstoquer/orgs","repos_url":"https://api.github.com/users/cstoquer/repos","events_url":"https://api.github.com/users/cstoquer/events{/privacy}","received_events_url":"https://api.github.com/users/cstoquer/received_events","type":"User","site_admin":false},"repo":{"id":41461497,"name":"AudioManager","full_name":"cstoquer/AudioManager","owner":{"login":"cstoquer","id":2462139,"avatar_url":"https://avatars.githubusercontent.com/u/2462139?v=3","gravatar_id":"","url":"https://api.github.com/users/cstoquer","html_url":"https://github.com/cstoquer","followers_url":"https://api.github.com/users/cstoquer/followers","following_url":"https://api.github.com/users/cstoquer/following{/other_user}","gists_url":"https://api.github.com/users/cstoquer/gists{/gist_id}","starred_url":"https://api.github.com/users/cstoquer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstoquer/subscriptions","organizations_url":"https://api.github.com/users/cstoquer/orgs","repos_url":"https://api.github.com/users/cstoquer/repos","events_url":"https://api.github.com/users/cstoquer/events{/privacy}","received_events_url":"https://api.github.com/users/cstoquer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cstoquer/AudioManager","description":"play sounds using Web Audio, fallback on HTML5 Audio","fork":true,"url":"https://api.github.com/repos/cstoquer/AudioManager","forks_url":"https://api.github.com/repos/cstoquer/AudioManager/forks","keys_url":"https://api.github.com/repos/cstoquer/AudioManager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cstoquer/AudioManager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cstoquer/AudioManager/teams","hooks_url":"https://api.github.com/repos/cstoquer/AudioManager/hooks","issue_events_url":"https://api.github.com/repos/cstoquer/AudioManager/issues/events{/number}","events_url":"https://api.github.com/repos/cstoquer/AudioManager/events","assignees_url":"https://api.github.com/repos/cstoquer/AudioManager/assignees{/user}","branches_url":"https://api.github.com/repos/cstoquer/AudioManager/branches{/branch}","tags_url":"https://api.github.com/repos/cstoquer/AudioManager/tags","blobs_url":"https://api.github.com/repos/cstoquer/AudioManager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cstoquer/AudioManager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cstoquer/AudioManager/git/refs{/sha}","trees_url":"https://api.github.com/repos/cstoquer/AudioManager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cstoquer/AudioManager/statuses/{sha}","languages_url":"https://api.github.com/repos/cstoquer/AudioManager/languages","stargazers_url":"https://api.github.com/repos/cstoquer/AudioManager/stargazers","contributors_url":"https://api.github.com/repos/cstoquer/AudioManager/contributors","subscribers_url":"https://api.github.com/repos/cstoquer/AudioManager/subscribers","subscription_url":"https://api.github.com/repos/cstoquer/AudioManager/subscription","commits_url":"https://api.github.com/repos/cstoquer/AudioManager/commits{/sha}","git_commits_url":"https://api.github.com/repos/cstoquer/AudioManager/git/commits{/sha}","comments_url":"https://api.github.com/repos/cstoquer/AudioManager/comments{/number}","issue_comment_url":"https://api.github.com/repos/cstoquer/AudioManager/issues/comments{/number}","contents_url":"https://api.github.com/repos/cstoquer/AudioManager/contents/{+path}","compare_url":"https://api.github.com/repos/cstoquer/AudioManager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cstoquer/AudioManager/merges","archive_url":"https://api.github.com/repos/cstoquer/AudioManager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cstoquer/AudioManager/downloads","issues_url":"https://api.github.com/repos/cstoquer/AudioManager/issues{/number}","pulls_url":"https://api.github.com/repos/cstoquer/AudioManager/pulls{/number}","milestones_url":"https://api.github.com/repos/cstoquer/AudioManager/milestones{/number}","notifications_url":"https://api.github.com/repos/cstoquer/AudioManager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cstoquer/AudioManager/labels{/name}","releases_url":"https://api.github.com/repos/cstoquer/AudioManager/releases{/id}","created_at":"2015-08-27T02:34:06Z","updated_at":"2015-08-27T02:34:07Z","pushed_at":"2015-12-15T09:17:21Z","git_url":"git://github.com/cstoquer/AudioManager.git","ssh_url":"git@github.com:cstoquer/AudioManager.git","clone_url":"https://github.com/cstoquer/AudioManager.git","svn_url":"https://github.com/cstoquer/AudioManager","homepage":null,"size":50,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Wizcorp:master","ref":"master","sha":"7ffb5dd22b6daad5cc2314800b4e65fa9c2d1343","user":{"login":"Wizcorp","id":592346,"avatar_url":"https://avatars.githubusercontent.com/u/592346?v=3","gravatar_id":"","url":"https://api.github.com/users/Wizcorp","html_url":"https://github.com/Wizcorp","followers_url":"https://api.github.com/users/Wizcorp/followers","following_url":"https://api.github.com/users/Wizcorp/following{/other_user}","gists_url":"https://api.github.com/users/Wizcorp/gists{/gist_id}","starred_url":"https://api.github.com/users/Wizcorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wizcorp/subscriptions","organizations_url":"https://api.github.com/users/Wizcorp/orgs","repos_url":"https://api.github.com/users/Wizcorp/repos","events_url":"https://api.github.com/users/Wizcorp/events{/privacy}","received_events_url":"https://api.github.com/users/Wizcorp/received_events","type":"Organization","site_admin":false},"repo":{"id":37699565,"name":"AudioManager","full_name":"Wizcorp/AudioManager","owner":{"login":"Wizcorp","id":592346,"avatar_url":"https://avatars.githubusercontent.com/u/592346?v=3","gravatar_id":"","url":"https://api.github.com/users/Wizcorp","html_url":"https://github.com/Wizcorp","followers_url":"https://api.github.com/users/Wizcorp/followers","following_url":"https://api.github.com/users/Wizcorp/following{/other_user}","gists_url":"https://api.github.com/users/Wizcorp/gists{/gist_id}","starred_url":"https://api.github.com/users/Wizcorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wizcorp/subscriptions","organizations_url":"https://api.github.com/users/Wizcorp/orgs","repos_url":"https://api.github.com/users/Wizcorp/repos","events_url":"https://api.github.com/users/Wizcorp/events{/privacy}","received_events_url":"https://api.github.com/users/Wizcorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wizcorp/AudioManager","description":"play sounds using Web Audio, fallback on HTML5 Audio","fork":false,"url":"https://api.github.com/repos/Wizcorp/AudioManager","forks_url":"https://api.github.com/repos/Wizcorp/AudioManager/forks","keys_url":"https://api.github.com/repos/Wizcorp/AudioManager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wizcorp/AudioManager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wizcorp/AudioManager/teams","hooks_url":"https://api.github.com/repos/Wizcorp/AudioManager/hooks","issue_events_url":"https://api.github.com/repos/Wizcorp/AudioManager/issues/events{/number}","events_url":"https://api.github.com/repos/Wizcorp/AudioManager/events","assignees_url":"https://api.github.com/repos/Wizcorp/AudioManager/assignees{/user}","branches_url":"https://api.github.com/repos/Wizcorp/AudioManager/branches{/branch}","tags_url":"https://api.github.com/repos/Wizcorp/AudioManager/tags","blobs_url":"https://api.github.com/repos/Wizcorp/AudioManager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wizcorp/AudioManager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wizcorp/AudioManager/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wizcorp/AudioManager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wizcorp/AudioManager/statuses/{sha}","languages_url":"https://api.github.com/repos/Wizcorp/AudioManager/languages","stargazers_url":"https://api.github.com/repos/Wizcorp/AudioManager/stargazers","contributors_url":"https://api.github.com/repos/Wizcorp/AudioManager/contributors","subscribers_url":"https://api.github.com/repos/Wizcorp/AudioManager/subscribers","subscription_url":"https://api.github.com/repos/Wizcorp/AudioManager/subscription","commits_url":"https://api.github.com/repos/Wizcorp/AudioManager/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wizcorp/AudioManager/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wizcorp/AudioManager/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wizcorp/AudioManager/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wizcorp/AudioManager/contents/{+path}","compare_url":"https://api.github.com/repos/Wizcorp/AudioManager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wizcorp/AudioManager/merges","archive_url":"https://api.github.com/repos/Wizcorp/AudioManager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wizcorp/AudioManager/downloads","issues_url":"https://api.github.com/repos/Wizcorp/AudioManager/issues{/number}","pulls_url":"https://api.github.com/repos/Wizcorp/AudioManager/pulls{/number}","milestones_url":"https://api.github.com/repos/Wizcorp/AudioManager/milestones{/number}","notifications_url":"https://api.github.com/repos/Wizcorp/AudioManager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wizcorp/AudioManager/labels{/name}","releases_url":"https://api.github.com/repos/Wizcorp/AudioManager/releases{/id}","created_at":"2015-06-19T03:31:27Z","updated_at":"2015-08-28T07:35:31Z","pushed_at":"2015-12-15T09:17:21Z","git_url":"git://github.com/Wizcorp/AudioManager.git","ssh_url":"git@github.com:Wizcorp/AudioManager.git","clone_url":"https://github.com/Wizcorp/AudioManager.git","svn_url":"https://github.com/Wizcorp/AudioManager","homepage":null,"size":212,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/12"},"html":{"href":"https://github.com/Wizcorp/AudioManager/pull/12"},"issue":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/issues/12"},"comments":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/statuses/f6e40e29cf497c54057296e0522e22f45c75bcb7"}}}}