return out
avdir = os.path.expanduser("~")audiofiles = get_audio_files_in_dir(avdir)
if len(audiofiles) == 0:
st.write(
"Put some audio files in your home directory (%s) to activate this player."
% avdir
)
else:
filename = st.selectbox(
"Select an audio file from your home directory (%s) to play" % avdir,
audiofiles,
0,
)
audiopath = os.path.join(avdir, filename)