`st.audio_input()` not recording audio in any browser

st.audio_input() not recording audio in any browser

Summary

st.audio_input() is not capturing any audio input across multiple browsers (Chrome, Firefox, Edge). The microphone widget appears, but no audio data is recorded when speaking.

Environment

  • Streamlit version: 1.48.0 or higher
  • Python version: 3.12.3
  • Operating System: windows
  • Browsers tested: Chrome, Firefox, Edge
  • Deployment: [Local / docker container]

Problem Description

I’m trying to implement voice input in my Streamlit app using st.audio_input(). The widget renders correctly and shows the microphone interface, but it doesn’t capture any audio when I speak into the microphone.

What I’ve verified:

:white_check_mark: Browser microphone permissions are granted
:white_check_mark: Microphone works on other (non-Streamlit) websites
:white_check_mark: Tested on multiple browsers (Chrome, Firefox, Edge)
:white_check_mark: Tested by multiple users (colleague has same issue)
:white_check_mark: Even the example on the official Streamlit documentation page doesn’t work

Code Example

import streamlit as st

audio_value = st.audio_input("Record a voice message")

if audio_value:
    st.audio(audio_value)

Is anyone else having the same issue?

@RRO I was working a several version between 1.47 and 1.51. Never had this issue.

What if you deploy it on streamlit cloud? What about other audio recorders (there are others for streamlit). Is the record indicator moving?

So even it doesn’t work in your local when you run ‘stremmlit run app.py’? What about using it without docker?

Hello @RRO !

I’am agree with @Gerg1 , you should test it outside from your docker container.

If other widgets than st.audio_input() work inside your docker container, maybe will st.file_uploader() also fail. In this case, its a problem of docker’s directories and/or permission issues.

The following article ends with “Further reading” with clever dockers links.

I hope it helps :slightly_smiling_face:

jp

Hello,

thank you for your answers! It is working again! Why? I have no idea.

The interesting part was that it was not working on the streamlit documentation example for st.audio aswell as the code in localhost or the deployed docker code.

I assume it had something to do with the browser not streamlit itself.