-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_audio.py
More file actions
36 lines (31 loc) · 975 Bytes
/
app_audio.py
File metadata and controls
36 lines (31 loc) · 975 Bytes
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
import time
import threading
from config import CONFIG, get_save_path
from tts import configure_tts, speak
from chains import create_chains
from conversation import ConversationManager
import speech_recognition as sr
import triggerDetection
import logging
import llm_gui
import streamlit as st
#Entry point of the application. Initializes components, creates dependencies, and starts necessary threads.
def main():
# Initialize components
logging.basicConfig(level=logging.DEBUG)
configure_tts()
# Create dependencies
recognizer = setup_recognizer()
chains = create_chains()
conversation = ConversationManager()
# Start threads
audio_thread = threading.Thread(target=listen_background, args=(recognizer,))
audio_thread.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
logging.info("Shutting down...")
audio_thread.join()
if __name__ == "__main__":
main()