-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On Firefox st.audio plays the input from st.audio_input sped up and twice #9799
Comments
Hey @RonaldAJ , I wasn't able to reproduce this issue locally on my MacBook microphone:( Do you have any ideas, though on what could be a cause of this behaviour (maybe microphone specific software, or any other preprocessing)? |
As the set-up is the same between Edge and Firefox, with Edge working correctly and Firefox not working correctly it could well be that the root cause is not in streamlit. As I am unfamiliar with typescript I cannot analyze much further. The fast speed suggests the data provided is read as if an input with two channels was expected while in fact a single channel was provided. What is at odds with that idea is the repetition of the sounds. A possible scenario is that the samples are read as 32 bit while being stored as 16 bit and then the two channels are merged into 1 leading to a repetition. Audio as perceived is remarkably robust against these type of signal deformations. |
I wasn't able to reproduce this issue. I tested on Chrome, Safari, Edge, and Firefox, and they all worked correctly. FYI: @kajarenc |
@kasim-inan Just to make sure: you did play with st.audio as opposed to the widget used for the recording? |
Firefox in my ubuntu 20 VM under virtualbox behaves the same as under windows. Brave works correctly. |
Hey @RonaldAJ ! I was able to confirm it. Looks like something in how Firefox is setting up the audio and how we upload it. I made a PR that should address it. I'd like to do some rigorous testing and make sure things work well for all use cases. Would appreciate if you confirmed the issue is resolved on your setup (Would love if other browsers were tested and verified as well. The wheel file is https://core-previews.s3-us-west-2.amazonaws.com/pr-9885/streamlit-1.40.1-py2.py3-none-any.whl Once downloaded you should uninstall streamlit and install streamlit with Appreciate help in getting this bug fixed :-) |
I reproduced the bug locally using firefox with the 1.40.0 release in a dedicated virtual environment: Steps:
import streamlit as st
f'{st.__version__=}'
audio_value = st.audio_input("Record a voice message")
if audio_value:
st.audio(audio_value)
Outcome: Then I failed to reproduce the bug locally using firefox with the provided wheel in a second dedicated virtual environment: Steps: Essentially the same but with the streamlit install step replaced by: Outcome: So it looks like the bug is fixed for Firefox (Version 132.0.2). Also checked Brave and it works with both versions. Extra data on environment: Python 3.10.12, Ubuntu 22.04.5 LTS |
@kmcgrady I had a look at the code, but I lack the context knowledge to judge it. |
Awesome! Thank you @RonaldAJ for testing and verifying. I'll get this reviewed internally and should get this into the next release. |
## Describe your changes Firefox is providing two channels based on the microphone. I re-assessed the WAV audio file and adjusted the conversion to work. It works now on my machine, and we will do a little QA. ## GitHub Issue Link (if applicable) closes streamlit#9799 ## Testing Plan - Rigorous manual testing --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
Checklist
Summary
When I make a recording with st.audio_input and use st.audio to play it the input from st.audio_input is played at high speed and then repeated.
Reproducible Code Example
Steps To Reproduce
To reproduce on Firefox:
On Edge it works correctly.
Expected Behavior
I expect to hear the sound made during the recording played at normal speed and only once.
Current Behavior
Despite clicking my tongue a single time I hear two clicks and the recording sounds like it is sped up.
Is this a regression?
Debug info
Additional Information
Note:
My firefox version is: Versie 132.0.1 (64-bits) on Windows10.
The text was updated successfully, but these errors were encountered: