It seems that st.audio() stopped working on iOS Safari. Similar
issue was already resolved in 2020 so…potential regression? Before posting an issue to github I would be gratefull if someone could check if you are encountering the same behavior
This file has been truncated.
import streamlit as st
import streamlit.components.v1 as components
from streamlit_extras.stoggle import stoggle
from streamlit_extras.metric_cards import style_metric_cards
# additional components from https://extras.streamlit.app/
# -------------- app config ---------------
st.set_page_config(page_title="StreamlitLand Adventure RPG", page_icon="🐲")
# define external css
with open(file_name) as f:
It works on my computer! Is it just not playing the audio on yours?
Actually I take that back, it’s only working on Chrome (not Safari)
Posted a response on the GitHub Issue, but I think you need to set
format="audio/mpeg" for mp3s, and it should work.
Let me know if you hit any more issues.
02:53PM - 11 Feb 23 UTC
- [X] I have searched the [existing issues](https://github.com/
… streamlit/streamlit/issues) for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.
It seems that st.audio() stopped working on iOS and Safari. Similar [issue](https://github.com/streamlit/streamlit/issues/2113) was already resolved in 2020 so…potential regression?
issue was confirmed by other streamlit users: https://discuss.streamlit.io/t/st-audio-stopped-working-on-ios-safari-again/37049
### Reproducible Code Example
### Steps To Reproduce
1. Go to https://adventure.streamlit.app/
2. Enter your name
3. Check if audio is working (it is on windows and android :) )
4. Github repo: https://github.com/tomjohnh/streamlit-game/blob/main/streamlit_app.py
### Expected Behavior
Audio widget is working
### Current Behavior
Audio widget is not working ("Error" message)
### Is this a regression?
- [ ] Yes, this used to work in a previous version.
### Debug info
- Streamlit version: 1.17
- Python version:
- Operating System: iOS
- Browser: Chrome on iOS / Safari
- Virtual environment:
### Additional Information
### Are you willing to submit a PR?
- [ ] Yes, I am willing to submit a PR!
February 13, 2023, 8:42am
@kmcgrady, thank you, it works! Awsome! I guess that we could edit the documentation to include this little but quite important fact
I’d hesitate to say it’s a docs issue. The default mime type for
audio/wav. Depending on the file you want to play, it can be
audio/webm, and so on:
RFC-defined mime type for
.mp3 files is
audio/mp3 as was in the app. Seems like programming user-error to me.
February 13, 2023, 11:11am
@snehankekre! True. It’s not a matter of insufficient documentation, however as an end-user, it would be helpful to have an MP3 example included in the documentation for better usability
Fair point! If it’s a fairly common use-case, it definitely warrants an example
I’ll add one this week