Update app.py
Browse files
app.py
CHANGED
|
@@ -16,6 +16,12 @@ objection_handler = ObjectionHandler('objections.csv')
|
|
| 16 |
product_recommender = ProductRecommender('recommendations.csv')
|
| 17 |
model = SentenceTransformer('all-MiniLM-L6-v2')
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
def real_time_analysis():
|
| 20 |
st.info("Listening... Say 'stop' to end the process.")
|
| 21 |
|
|
@@ -25,7 +31,11 @@ def real_time_analysis():
|
|
| 25 |
total_text = ""
|
| 26 |
|
| 27 |
try:
|
| 28 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
mic = sr.Microphone(device_index=0) # Use the virtual microphone device index
|
| 30 |
|
| 31 |
while True:
|
|
|
|
| 16 |
product_recommender = ProductRecommender('recommendations.csv')
|
| 17 |
model = SentenceTransformer('all-MiniLM-L6-v2')
|
| 18 |
|
| 19 |
+
def list_audio_devices():
|
| 20 |
+
"""List available audio input devices."""
|
| 21 |
+
recognizer = sr.Recognizer()
|
| 22 |
+
mic_list = sr.Microphone.list_microphone_names()
|
| 23 |
+
return mic_list
|
| 24 |
+
|
| 25 |
def real_time_analysis():
|
| 26 |
st.info("Listening... Say 'stop' to end the process.")
|
| 27 |
|
|
|
|
| 31 |
total_text = ""
|
| 32 |
|
| 33 |
try:
|
| 34 |
+
# List available audio devices
|
| 35 |
+
mic_list = list_audio_devices()
|
| 36 |
+
st.write(f"Available audio devices: {mic_list}")
|
| 37 |
+
|
| 38 |
+
# Use the virtual microphone (device index 0)
|
| 39 |
mic = sr.Microphone(device_index=0) # Use the virtual microphone device index
|
| 40 |
|
| 41 |
while True:
|