From e39c77807c702d495d0a687bda20c0336395d38e Mon Sep 17 00:00:00 2001 From: Jimmy Date: Thu, 17 Nov 2022 19:37:16 +1300 Subject: [PATCH] Cast to float --- pi/test_microphone.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pi/test_microphone.py b/pi/test_microphone.py index 2efdfa7..58df57a 100755 --- a/pi/test_microphone.py +++ b/pi/test_microphone.py @@ -43,10 +43,10 @@ async def run_test(): if "text" in j and "result" in j: n = 0 for word in j["result"]: - n += int(word["conf"]) - if int(word["conf"]) > 0.7: + n += float(word["conf"]) + if float(word["conf"]) > 0.7: print(colored(word["word"], "green"), end=" ") - elif int(word["conf"]) > 0.7: + elif float(word["conf"]) > 0.5: print(colored(word["word"], "yellow"), end=" ") else: print(colored(word["word"], "red"), end=" ")