payload: {"action":"created","issue":{"url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/1714","repository_url":"https://api.github.com/repos/katspaugh/wavesurfer.js","labels_url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/1714/labels{/name}","comments_url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/1714/comments","events_url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/1714/events","html_url":"https://github.com/katspaugh/wavesurfer.js/issues/1714","id":475812841,"node_id":"MDU6SXNzdWU0NzU4MTI4NDE=","number":1714,"title":"Waveform not in sync with MediaElement backend audio when zooming","user":{"login":"seklum","id":10859637,"node_id":"MDQ6VXNlcjEwODU5NjM3","avatar_url":"https://avatars3.githubusercontent.com/u/10859637?v=4","gravatar_id":"","url":"https://api.github.com/users/seklum","html_url":"https://github.com/seklum","followers_url":"https://api.github.com/users/seklum/followers","following_url":"https://api.github.com/users/seklum/following{/other_user}","gists_url":"https://api.github.com/users/seklum/gists{/gist_id}","starred_url":"https://api.github.com/users/seklum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seklum/subscriptions","organizations_url":"https://api.github.com/users/seklum/orgs","repos_url":"https://api.github.com/users/seklum/repos","events_url":"https://api.github.com/users/seklum/events{/privacy}","received_events_url":"https://api.github.com/users/seklum/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2019-08-01T17:54:34Z","updated_at":"2019-08-02T00:37:17Z","closed_at":null,"author_association":"NONE","body":"When zooming in enough it's clear that the majority of beats are heard before the actual section of the waveform is hit. It's a small amount but noticeable for the the project I am using it for. It appears that the audio is 0.04 seconds ahead of the progress bar. The song I am using is about 3 minutes long if that makes any difference.\r\n\r\n\r\nWavesurfer.js Version 3.0.0\r\n\r\nFirefox Developer Version 69.0b9 (64-bit)\r\nWindows 10\r\n\r\n```html\r\n<script>var wavesurfer = WaveSurfer.create({\r\n\tcontainer: '#waveform',\r\n\twaveColor: '#222222',\r\n\tprogressColor: 'orange',\r\n\tbackend: 'MediaElement',\r\n\tplugins: [\r\n\t\tWaveSurfer.cursor.create({\r\n\t\t\tshowTime: true,\r\n\t\t\topacity: 1,\r\n\t\t\tcolor: 'blue',\r\n\t\t\tcustomShowTimeStyle: {\r\n\t\t\t\t'background-color': '#000',\r\n\t\t\t\tcolor: '#fff',\r\n\t\t\t\tpadding: '2px',\r\n\t\t\t\t'font-size': '10px'\r\n\t\t\t}\r\n\t\t})\r\n\t]\r\n});\r\nwavesurfer.load(song);\r\n\r\n\r\n//Zoom slider\r\nvar slider = document.querySelector('[data-action=\"zoom\"]');\r\n\r\nslider.value = wavesurfer.params.minPxPerSec;\r\nslider.min = wavesurfer.params.minPxPerSec;\r\n\r\nslider.addEventListener('input', function() {\r\n\twavesurfer.zoom(Number(this.value));\r\n})\r\n\r\n//Set initial zoom to match slider value\r\nwavesurfer.zoom(slider.value);\r\n\r\nfunction playPause() {\r\n\twavesurfer.playPause();\r\n}</script>\r\n\r\n<div id=\"waveform\"></div>\r\n<input data-action=\"zoom\" type=\"range\" min=\"20\" max=\"200\" value=\"0\" style=\"width: 100%\">\r\n<button onClick=\"playPause()\">Play/Pause</button>\r\n```\r\n\r\n\r\nI can reproduce it with any of the songs that I currently have set up with my project."},"comment":{"url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/comments/517504760","html_url":"https://github.com/katspaugh/wavesurfer.js/issues/1714#issuecomment-517504760","issue_url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/1714","id":517504760,"node_id":"MDEyOklzc3VlQ29tbWVudDUxNzUwNDc2MA==","user":{"login":"seklum","id":10859637,"node_id":"MDQ6VXNlcjEwODU5NjM3","avatar_url":"https://avatars3.githubusercontent.com/u/10859637?v=4","gravatar_id":"","url":"https://api.github.com/users/seklum","html_url":"https://github.com/seklum","followers_url":"https://api.github.com/users/seklum/followers","following_url":"https://api.github.com/users/seklum/following{/other_user}","gists_url":"https://api.github.com/users/seklum/gists{/gist_id}","starred_url":"https://api.github.com/users/seklum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seklum/subscriptions","organizations_url":"https://api.github.com/users/seklum/orgs","repos_url":"https://api.github.com/users/seklum/repos","events_url":"https://api.github.com/users/seklum/events{/privacy}","received_events_url":"https://api.github.com/users/seklum/received_events","type":"User","site_admin":false},"created_at":"2019-08-02T00:37:17Z","updated_at":"2019-08-02T00:37:17Z","author_association":"NONE","body":"Ok so far I've at least looked over all the code in the mediaelement file. I can't see anything that looks like it would cause this. I've verified that the waveforms are not different they still display the same so it's something with the audio only.\r\n\r\nHere is one interesting thing I was able to find. At the end of the waveform when using the mediaelement backend the cursor extends a .02 seconds past the edge of the window extending it. This does not occur with the default backend. I don't know how to check the beginning but it appears that mediaelement has some sort of different duration value. It does appear to be approximately .04 which could be related to the .02 second extended duration at the end.\r\n\r\nThe audio is being clipped out for the first .04 seconds of the file and and extra .02s added to the end."}}
other: {"actor":{"display_login":"seklum"}}