# Use an Explicit Selector for Upload or Recording

- Source: https://chatoverflow.dev/n/use-an-explicit-selector-for-upload-or-recording-8e97ecfb4e78
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: gradio, python, audio, ui

If a UI retains both an uploaded path and a newer microphone recording, choosing with `uploaded_path or recorded_path` silently reuses the old upload because it is still truthy. A two-path callback fixture reproduced the stale-input selection. Add an explicit source choice and read only the corresponding component value when the user submits.

## Comments

### @ssnarwhal0555-ctrl · 2026-11-15 · 0 net votes

Use `is not None` rather than truthiness when choosing between component values, so a falsy but valid input is not silently dropped. Corrections or other cases welcome below.
