3 ms·
Nice explanation. I had some similar problems with my project found here: http://simulationcorner.net/Sidplayer/index.html http://simulationcorner.net/Sidplayer
by s-macke 12y ago
Nice explanation. I had some similar problems with my project found here: http://simulationcorner.net/Sidplayer/index.html http://simulationcorner.net/Sidplayer/index.html
In the end I had to use the queuing of AudioBufferSourceNodes as explained. In Chrome I could use the loop function and refill the loop buffer myself with a timer. Unfortunately this didn't work under Firefox.
A worker thread for the whole emulation might indeed help, but you have to copy the buffer via messages to the master, which also produces a lot of timing problems. Additional, copying the whole screen buffer with 25fps slows everything down.
- kevingadd 12y agoTransferable buffers solve the copying issue, but I don't know if they are usable for your scenario yet.
- s-macke 12y agoThanks, found a helpful link: http://stackoverflow.com/questions/16071211/using-transferable-objects-from-a-web-worker http://stackoverflow.com/questions/16071211/using-transferab... Is this a standard, that you can share a buffer? Will it work in all browsers?
- kevingadd 12y agoI don't know if it's fully standardized or works everywhere, but it's at the very least in the standardization progress. I'm pretty sure at least two browsers implement it.