{"action":"closed","issue":{"url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/777","repository_url":"https://api.github.com/repos/WebAudio/web-audio-api","labels_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/777/labels{/name}","comments_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/777/comments","events_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/777/events","html_url":"https://github.com/WebAudio/web-audio-api/issues/777","id":144977558,"number":777,"title":"AudioWorklet examples (2): Creating AudioWorkletNode","user":{"login":"hoch","id":676891,"avatar_url":"https://avatars.githubusercontent.com/u/676891?v=3","gravatar_id":"","url":"https://api.github.com/users/hoch","html_url":"https://github.com/hoch","followers_url":"https://api.github.com/users/hoch/followers","following_url":"https://api.github.com/users/hoch/following{/other_user}","gists_url":"https://api.github.com/users/hoch/gists{/gist_id}","starred_url":"https://api.github.com/users/hoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoch/subscriptions","organizations_url":"https://api.github.com/users/hoch/orgs","repos_url":"https://api.github.com/users/hoch/repos","events_url":"https://api.github.com/users/hoch/events{/privacy}","received_events_url":"https://api.github.com/users/hoch/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/WebAudio/web-audio-api/labels/Ready%20for%20Editing","name":"Ready for Editing","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":{"login":"hoch","id":676891,"avatar_url":"https://avatars.githubusercontent.com/u/676891?v=3","gravatar_id":"","url":"https://api.github.com/users/hoch","html_url":"https://github.com/hoch","followers_url":"https://api.github.com/users/hoch/followers","following_url":"https://api.github.com/users/hoch/following{/other_user}","gists_url":"https://api.github.com/users/hoch/gists{/gist_id}","starred_url":"https://api.github.com/users/hoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoch/subscriptions","organizations_url":"https://api.github.com/users/hoch/orgs","repos_url":"https://api.github.com/users/hoch/repos","events_url":"https://api.github.com/users/hoch/events{/privacy}","received_events_url":"https://api.github.com/users/hoch/received_events","type":"User","site_admin":false},"assignees":[{"login":"hoch","id":676891,"avatar_url":"https://avatars.githubusercontent.com/u/676891?v=3","gravatar_id":"","url":"https://api.github.com/users/hoch","html_url":"https://github.com/hoch","followers_url":"https://api.github.com/users/hoch/followers","following_url":"https://api.github.com/users/hoch/following{/other_user}","gists_url":"https://api.github.com/users/hoch/gists{/gist_id}","starred_url":"https://api.github.com/users/hoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoch/subscriptions","organizations_url":"https://api.github.com/users/hoch/orgs","repos_url":"https://api.github.com/users/hoch/repos","events_url":"https://api.github.com/users/hoch/events{/privacy}","received_events_url":"https://api.github.com/users/hoch/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/WebAudio/web-audio-api/milestones/1","html_url":"https://github.com/WebAudio/web-audio-api/milestones/Web%20Audio%20V1","labels_url":"https://api.github.com/repos/WebAudio/web-audio-api/milestones/1/labels","id":444685,"number":1,"title":"Web Audio V1","description":"Issues to be resolved to enable V1 to be taken forward.","creator":{"login":"olivierthereaux","id":604646,"avatar_url":"https://avatars.githubusercontent.com/u/604646?v=3","gravatar_id":"","url":"https://api.github.com/users/olivierthereaux","html_url":"https://github.com/olivierthereaux","followers_url":"https://api.github.com/users/olivierthereaux/followers","following_url":"https://api.github.com/users/olivierthereaux/following{/other_user}","gists_url":"https://api.github.com/users/olivierthereaux/gists{/gist_id}","starred_url":"https://api.github.com/users/olivierthereaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olivierthereaux/subscriptions","organizations_url":"https://api.github.com/users/olivierthereaux/orgs","repos_url":"https://api.github.com/users/olivierthereaux/repos","events_url":"https://api.github.com/users/olivierthereaux/events{/privacy}","received_events_url":"https://api.github.com/users/olivierthereaux/received_events","type":"User","site_admin":false},"open_issues":69,"closed_issues":172,"state":"open","created_at":"2013-10-03T15:27:25Z","updated_at":"2016-07-14T17:15:52Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-03-31T18:14:41Z","updated_at":"2016-07-14T17:15:52Z","closed_at":"2016-07-14T17:15:52Z","body":"# IDL\r\n\r\n```webidl\r\n[Constructor(DOMString name\r\n    , AudioContext audioContext\r\n    , any options\r\n    , AudioNodeDescriptor? audioNodeDescriptor)]\r\npartial interface AudioWorkletNode : AudioNode {\r\n}\r\n\r\npartial interface BaseAudioContext : EventTarget {\r\n    AudioWorkletNode createAudioWorketNode(DOMString name\r\n        , any options\r\n        , AudioNodeDescriptor? audioNodeDescriptor);\r\n}\r\n\r\ndictionary AudioNodeDescriptor {\r\n    readonly attribute unsigned long numberOfInputs = 1;\r\n    readonly attribute unsigned long numberOfOutputs = 1;\r\n    attribute unsigned long channelCount = 1;\r\n    attribute ChannelCountMode channelCountMode = \"max\";\r\n    attribute ChannelInterpretation channelInterpretation = \"speakers\";\r\n}\r\n```\r\n\r\n# Examples\r\n\r\n_Note that this pattern is branched out the pattern 1 from #776._\r\n\r\nOnce scripts are loaded, `AudioContext` or the constructor of `AudioWorkletNode` can instantiate the node from the imported definition:\r\n\r\n```js\r\nfunction onAudioWorkletReady() {\r\n  var context = new AudioContext();\r\n  var osc = new OscillatorNode(context);\r\n  var fooNode = new AudioWorkletNode('fooNode', context, { gain: 0.707 });\r\n  var barNode = new AudioWorkletNode('barNode', context);\r\n\r\n  osc.connect(fooNode).connect(barNode).connect(context.destination);\r\n}\r\n\r\nPromise.all([\r\n  audioWorklet.import('fooNode.js'),\r\n  audioWorklet.import('barNode.js')\r\n]).then(onAudioWorkletReady);\r\n```"}}
{"actor":{"display_login":"mdjp"}}