{"action":"created","issue":{"url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/1148","repository_url":"https://api.github.com/repos/WebAudio/web-audio-api","labels_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/1148/labels{/name}","comments_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/1148/comments","events_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/1148/events","html_url":"https://github.com/WebAudio/web-audio-api/issues/1148","id":207407429,"number":1148,"title":"MSE (+EME) does not enable accurate scheduling of playback from HTMLMediaElement","user":{"login":"kirbysayshi","id":90831,"avatar_url":"https://avatars3.githubusercontent.com/u/90831?v=3","gravatar_id":"","url":"https://api.github.com/users/kirbysayshi","html_url":"https://github.com/kirbysayshi","followers_url":"https://api.github.com/users/kirbysayshi/followers","following_url":"https://api.github.com/users/kirbysayshi/following{/other_user}","gists_url":"https://api.github.com/users/kirbysayshi/gists{/gist_id}","starred_url":"https://api.github.com/users/kirbysayshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirbysayshi/subscriptions","organizations_url":"https://api.github.com/users/kirbysayshi/orgs","repos_url":"https://api.github.com/users/kirbysayshi/repos","events_url":"https://api.github.com/users/kirbysayshi/events{/privacy}","received_events_url":"https://api.github.com/users/kirbysayshi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/WebAudio/web-audio-api/milestones/2","html_url":"https://github.com/WebAudio/web-audio-api/milestone/2","labels_url":"https://api.github.com/repos/WebAudio/web-audio-api/milestones/2/labels","id":444686,"number":2,"title":"Web Audio v.next","description":"Postponed to next version of the Web Audio API.","creator":{"login":"olivierthereaux","id":604646,"avatar_url":"https://avatars1.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":54,"closed_issues":5,"state":"open","created_at":"2013-10-03T15:27:49Z","updated_at":"2017-04-13T16:24:31Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2017-02-14T03:24:26Z","updated_at":"2017-06-13T08:20:05Z","closed_at":null,"body":"An example use case is a live DJ mixing tool:\r\n\r\n- Audio Track A, tempo 115\r\n- Audio Track B, tempo 115\r\n- The user wants to trigger Track B to begin on the last beat of Track A (assuming the user knows where the last beat is in seconds).\r\n\r\nBoth tracks use EME, and thus cannot be decoded into AudioBuffer chunks. They must use `<audio>` tags, which only offers the `.play()` interface.\r\n\r\n[As this jsfiddle shows](https://jsfiddle.net/k07v5vnn/latest), executing `.play` on two `<audio>` tags in the same tick does not guarantee that playback will begin in sync (although that test, due to how bare bones it is, does allow them to play ~10ms of each other in FF, chrome is a much more audible ~30ms. A real-world example including the actual EME decryption would be considerably more delayed. The promise interface also adds ~30ms).\r\n\r\nMSE's `createMediaElementSource` (which is permitted in Chrome for EME `<audio>`) is the \"bridge\" between these two APIs, but does not provide an alternate scheduling interface for playback: the `<audio>` tag is still bound by the HTMLMediaElement interface, which has inconsistent timing (at least according to my tests).\r\n\r\nPerhaps I'm missing a technique that allows accurate MSE playback scheduling?"},"comment":{"url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/comments/308043024","html_url":"https://github.com/WebAudio/web-audio-api/issues/1148#issuecomment-308043024","issue_url":"https://api.github.com/repos/WebAudio/web-audio-api/issues/1148","id":308043024,"user":{"login":"padenot","id":270485,"avatar_url":"https://avatars2.githubusercontent.com/u/270485?v=3","gravatar_id":"","url":"https://api.github.com/users/padenot","html_url":"https://github.com/padenot","followers_url":"https://api.github.com/users/padenot/followers","following_url":"https://api.github.com/users/padenot/following{/other_user}","gists_url":"https://api.github.com/users/padenot/gists{/gist_id}","starred_url":"https://api.github.com/users/padenot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/padenot/subscriptions","organizations_url":"https://api.github.com/users/padenot/orgs","repos_url":"https://api.github.com/users/padenot/repos","events_url":"https://api.github.com/users/padenot/events{/privacy}","received_events_url":"https://api.github.com/users/padenot/received_events","type":"User","site_admin":false},"created_at":"2017-06-13T08:20:05Z","updated_at":"2017-06-13T08:20:05Z","body":"> @padenot do you know of a procedure to get the EME content accurately? As far as I know, the only technique is createMediaElementSource + scriptProcessorNode; but this approach is flawed since there is no way to know when the data flowing into the scriptProcessorNode is real yet slient audio, or 0-samples while waiting for the HTMLMediaElement to begin playing.\r\n\r\n[MediaRecorder](https://w3c.github.io/mediacapture-record/) +  [HTMLMediaElement.captureStream](https://w3c.github.io/mediacapture-fromelement/#dom-htmlmediaelement-capturestream()). No need for the Web Audio API here."}}
{"actor":{"display_login":"padenot"}}