diff --git a/node-server/assets/script.js b/node-server/assets/script.js index be921a6..e641262 100644 --- a/node-server/assets/script.js +++ b/node-server/assets/script.js @@ -33,7 +33,7 @@ socket.on('position', (position) => { clearTimeout(idleTimeout); // Seuil de mouvement pour arrêt - if (Math.abs(speed) < 5) { + if (Math.abs(speed) < 2) { stopPlayback(); return; } @@ -50,8 +50,9 @@ socket.on('position', (position) => { audio.play(); isPlaying = true; } - let playbackSpeed = 0.5 + speed / 400; - playbackSpeed = Math.min(Math.max(playbackSpeed, 0.5), 1.5); + // SENSIBILITÉ : le facteur diviseur est plus grand → plus doux + let playbackSpeed = 0.5 + speed / 1000; + playbackSpeed = Math.min(Math.max(playbackSpeed, 0.5), 1.0); // plage limitée à x1 max audio.playbackRate = playbackSpeed; } }