-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfast_app.py
35 lines (26 loc) · 1.07 KB
/
fast_app.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
import sys
import os
pckg_dir = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..'))
sys.path.append(pckg_dir)
import logging
from .SpeechToText import SpeechToText
from ..utils import ToolFastApp, load_yaml, log_config
if __name__ == '__main__':
log_config()
logging.info("Starting the T8_STT process...")
# Load the configuration parameters from the config file
params = load_yaml("Tools/parameters.yaml")["T8_STT"]
# Initialize the SpeechToText object
speech_to_text = SpeechToText(
model_size=params["model_size"],
input_wav_file=params["input_wav_file"],
output_text_file=params["output_text_file"]
)
logging.info("T8_STT object initialized successfully.")
T8_fast_app = ToolFastApp(
command_dict = {"start": speech_to_text.start, "stop": speech_to_text.stop},
get_status_function = speech_to_text.get_running,
status_file = "Tools/T8_STT/fast_com/status.txt",
command_file = "Tools/T8_STT/fast_com/command.txt"
)
T8_fast_app.run()