demoAsg / app.py
isom5240's picture
Update app.py
08d678f verified
raw
history blame contribute delete
732 Bytes
import streamlit as st
from PIL import Image
import time
# Title of the Streamlit app
st.title("Streamlit Testing App")
# Write a description
st.write("This app tests various Streamlit elements like file uploader, image display, and audio playback.")
# File uploader for image
uploaded_file = st.file_uploader("Upload an image", type=["png", "jpg", "jpeg"])
if uploaded_file is not None:
# Display the uploaded image
image = Image.open(uploaded_file)
st.image(image, caption="Uploaded Image", use_container_width=True)
# Display an audio file with a spinner effect
st.write("Playing audio...")
with st.spinner("Loading audio..."):
time.sleep(2) # Simulating a short delay
st.audio("kids_playing_audio.wav")