From d43a726f4a6f8c8f59a79a240ad8fc3de3abd525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Sat, 18 May 2019 03:27:29 +0200 Subject: [PATCH] put max and min value --- commands/fun/tts/sam.js | 8 ++++++++ commands/fun/tts/samvc.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/commands/fun/tts/sam.js b/commands/fun/tts/sam.js index ac258e3..63807ee 100644 --- a/commands/fun/tts/sam.js +++ b/commands/fun/tts/sam.js @@ -33,6 +33,10 @@ class samCommand extends Command { i = pitch.length; } } + if (pitch > 200) + pitch = 200; + else if (pitch < 50) + pitch = 50; } else { pitch = 100; } @@ -47,6 +51,10 @@ class samCommand extends Command { i = speed.length; } } + if (speed > 450) + speed = 450; + else if (speed < 30) + speed = 30; } else { speed = 150; } diff --git a/commands/fun/tts/samvc.js b/commands/fun/tts/samvc.js index 2595fe5..469ab9a 100644 --- a/commands/fun/tts/samvc.js +++ b/commands/fun/tts/samvc.js @@ -33,6 +33,10 @@ class samvcCommand extends Command { i = pitch.length; } } + if (pitch > 200) + pitch = 200; + else if (pitch < 50) + pitch = 50; } else { pitch = 100; } @@ -47,6 +51,10 @@ class samvcCommand extends Command { i = speed.length; } } + if (speed > 450) + speed = 450; + else if (speed < 30) + speed = 30; } else { speed = 150; }