Merge pull request 'Fix AudioContext change detection. Use AudioNode.context' (#1858) from jeromew/strudel:fix-scope into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1858
This commit is contained in:
commit
616bc64e70
1 changed files with 1 additions and 3 deletions
|
|
@ -359,9 +359,7 @@ export let analysers = {},
|
|||
analysersData = {};
|
||||
|
||||
export function getAnalyserById(id, fftSize = 1024, smoothingTimeConstant = 0.5) {
|
||||
// below commented out branch is hotfixing https://codeberg.org/uzu/strudel/issues/1847
|
||||
// might cause conflicts with exporting...
|
||||
if (!analysers[id] /* || analysers[id].audioContext != getAudioContext() */) {
|
||||
if (!analysers[id] || analysers[id].context != getAudioContext()) {
|
||||
// make sure this doesn't happen too often as it piles up garbage
|
||||
const analyserNode = getAudioContext().createAnalyser();
|
||||
analyserNode.fftSize = fftSize;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue