OSError: libespeak.so.1: cannot open shared object file: No such file or directory

I think there is quite a technical misunderstanding here.
It’s clear that this works locally, but how would it work on streamlit sharing?
playsound plays the audio file via the local audio driver of the machine on which the Python script is running. In the case of Streamlit Sharing, this is probably some Docker container in a cloud data center. It doesn’t even have an audio driver.

If you want this to work, you would have to use a custom component that uses an audio-capable Browser API, e.g. Web Audio API, WebRTC

Or you can use the Streamlit component streamlit.audio()
However this component has no autoplay capability yet.

@randyzwitch Please correct me if i am wrong.

1 Like