Hi!
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
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
import time
import random
import game_scenes
# additional components from https://extras.streamlit.app/
# -------------- app config ---------------
st.set_page_config(page_title="StreamlitLand Adventure RPG", page_icon="🐲")
# define external css
def local_css(file_name):
with open(file_name) as f:
st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
This file has been truncated. show original
Hey @TomJohn ,
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)
1 Like
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.
opened 02:53PM - 11 Feb 23 UTC
type:bug
status:awaiting-user-response
### Checklist
- [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.
### Summary
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
_No response_
### 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
_No response_
### Are you willing to submit a PR?
- [ ] Yes, I am willing to submit a PR!
2 Likes
TomJohn
February 13, 2023, 8:42am
5
kmcgrady:
mpeg
Hi @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 st.audio is audio/wav. Depending on the file you want to play, it can be audio/aac, audio/midi, audio/ogg, audio/webm, and so on:
The RFC-defined mime type for .mp3 files is audio/mpeg, not audio/mp3 as was in the app. Seems like programming user-error to me.
1 Like
TomJohn
February 13, 2023, 11:11am
7
Hi @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
2 Likes
system
Closed
February 13, 2024, 11:16am
9
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Nice ! I love the example mp3 purrrr