harsh2ai
commited on
Commit
·
b367052
1
Parent(s):
010c62d
Add streaming configuration parameters for user tuning
Browse files
app.py
CHANGED
|
@@ -248,6 +248,36 @@ def create_interface():
|
|
| 248 |
Make sure your backend service is running and accessible.
|
| 249 |
""")
|
| 250 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 251 |
mic_input = gr.Audio(
|
| 252 |
sources=["microphone"],
|
| 253 |
type="numpy",
|
|
|
|
| 248 |
Make sure your backend service is running and accessible.
|
| 249 |
""")
|
| 250 |
|
| 251 |
+
# Buffer Configuration Controls
|
| 252 |
+
with gr.Row():
|
| 253 |
+
with gr.Column():
|
| 254 |
+
gr.Markdown("### 🔧 Streaming Configuration")
|
| 255 |
+
gr.Markdown("Adjust these settings to optimize streaming performance based on your connection.")
|
| 256 |
+
|
| 257 |
+
buffer_duration = gr.Slider(
|
| 258 |
+
minimum=2.0, maximum=6.0, step=0.5, value=3.0,
|
| 259 |
+
label="Buffer Duration (seconds)",
|
| 260 |
+
info="Size of audio chunks sent to API"
|
| 261 |
+
)
|
| 262 |
+
process_every_n = gr.Slider(
|
| 263 |
+
minimum=2, maximum=8, step=1, value=3,
|
| 264 |
+
label="Process Every N Chunks",
|
| 265 |
+
info="How often to send audio (higher = less frequent)"
|
| 266 |
+
)
|
| 267 |
+
min_interval = gr.Slider(
|
| 268 |
+
minimum=1.0, maximum=4.0, step=0.5, value=2.0,
|
| 269 |
+
label="Min Processing Interval (seconds)",
|
| 270 |
+
info="Minimum time between API calls"
|
| 271 |
+
)
|
| 272 |
+
|
| 273 |
+
gr.Markdown("""
|
| 274 |
+
**💡 Tuning Tips:**
|
| 275 |
+
- **Lower latency**: Decrease buffer duration and interval
|
| 276 |
+
- **Better accuracy**: Increase buffer duration
|
| 277 |
+
- **Reduce API calls**: Increase process frequency
|
| 278 |
+
- **Slow connection**: Increase all values
|
| 279 |
+
""")
|
| 280 |
+
|
| 281 |
mic_input = gr.Audio(
|
| 282 |
sources=["microphone"],
|
| 283 |
type="numpy",
|