Web demo: don't show scope on mobile browsers

This commit is contained in:
Geraint 2025-04-19 10:02:37 +01:00
parent 4d158cba47
commit 83f32d337b

View File

@ -156,12 +156,15 @@
};
let configValues = Object.assign({}, configValuesInitial);
// add scope, for fun
let scope = await Scope(audioContext);
scope.connect(audioContext.destination);
let scopeFrame = scope.openInterface();
scopeFrame.id = 'scope';
document.body.appendChild(scopeFrame);
let scope;
if (!/Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile/.test(navigator.userAgent)) {
// add scope for fun, but only on desktop
scope = await Scope(audioContext);
scope.connect(audioContext.destination);
let scopeFrame = scope.openInterface();
scopeFrame.id = 'scope';
document.body.appendChild(scopeFrame);
}
// Drop zone
document.body.ondragover = event => {
@ -195,7 +198,7 @@
stretch.disconnect();
}
stretch = await SignalsmithStretch(audioContext);
stretch.connect(scope);
stretch.connect(scope || audioContext.destination);
await stretch.addBuffers(channelBuffers);
controlValues.loopEnd = audioDuration;
configChanged();