-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestPico.py
37 lines (26 loc) · 806 Bytes
/
testPico.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from picoThread import PicovoiceThread as picoT
import argparse
# Create a GUI using Tkinter
import tkinter as tk
parser = argparse.ArgumentParser()
parser.add_argument(
'--access_key',
help='AccessKey obtained from Picovoice Console (https://picovoice.ai/console/)',
required=True)
args = parser.parse_args()
window = tk.Tk()
window.title("Pico Testing")
window.minsize(width=400, height=200)
timeLabel = tk.Label(window, text='00 : 00 : 00', font=("Arial", 80))
timeLabel.pack(fill=tk.BOTH, pady=90)
picoThread = picoT(timeLabel, args.access_key)
def onClose():
picoThread.stop()
while not picoThread.is_stopped():
pass
window.destroy()
window.protocol('WM_DELETE_WINDOW', onClose)
picoThread.start()
while not picoThread.is_ready():
pass
window.mainloop()