-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdefinitions.py
41 lines (32 loc) · 953 Bytes
/
definitions.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
38
39
40
41
import os
import pyaudio
# global
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
LOGFILE_PATH = os.path.join(ROOT_DIR, "app.log")
HISTORY_FILE_PATH = os.path.join(ROOT_DIR, "history.csv")
STYLES_FILE_PATH = os.path.join(ROOT_DIR, 'gui/style.qss')
# resources path
RES_PATH = os.path.join(ROOT_DIR, "resources")
NO_IMAGE_ICON = os.path.join(RES_PATH, "no_image_icon.png")
ICO_PATH = os.path.join(RES_PATH, "app_logo_v2_2.ico")
# gui settings
MIN_IMAGE_SIZE = 250
# recorder settings
DEFAULT_FRAMES = 512
CHUNK = 1024
FORMAT = pyaudio.paInt16
RATE = 48000
RECORD_SECONDS = 9
EXCERPT_PATH = os.path.join(ROOT_DIR, "excerpt.wav")
# update listen btn settings
UPDATE_RATE = 10 # times per second
WAITING_TIME = 25 # seconds
# WAITING_TIME = RECORD_TIMEOUT + RECOGNISE_TIMEOUT
# timeouts
RECORD_TIMEOUT = 10
RECOGNIZE_TIMEOUT = 15
# history model
ITEM_SELECTION_CODE = 200
# api
HOST = "http://2.56.240.213:4000"
API_LINK = HOST + "/api/v1"