Tonejs / Tone.js

A Web Audio framework for making interactive music in the browser.
https://tonejs.github.io
MIT License
13.39k stars 976 forks source link

Sampler playing paused when window.print() #1109

Closed Erin122 closed 4 months ago

Erin122 commented 2 years ago

Describe the bug

I work with project that plays audio and tonejs sampler notes together. However, when I open window.print(), audio buffer is playing but sampler's playing sound stops. After I close the print window, sampler's sounds resume again. Is this intended situation ? Or the bug ? Or there is any solution for handling this issue ?

To Reproduce

Tone.Transport with synced audio buffer Player and Sampler. play and window.print()

Expected behavior Audio buffer Player and Sampler both play together even if I open print window.

What I've tried How have you tried resolving/debugging this issue? This can be helpful context for getting to the heart of the issue faster and not duplicating effort.

Additional context Add any other context about the problem here.

tambien commented 2 years ago

This seems like probably has to do with the way that browser's pause javascript execution when a dialog like the print dialog is open. I'm not sure if there's anything we can do on the Tone.js-side of things to deal with this.