Skip to content

neverude/st_rec

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Audio Recorder for streamlit

Streamlit App

Audio recorder component for streamlit.
It creates a button: one click to start recording, one click to stop recording.
The return value is a numpy array. After conversion to bytes using .tobytes(), it can be passed to st.audio or written to disk as an audio file.

Install it with pip:

pip install streamlit-audiorecorder

Use it:

import streamlit as st
from audiorecorder import audiorecorder

st.title("Audio Recorder")
audio = audiorecorder("Click to record", "Recording...")

if len(audio) > 0:
    # To play audio in frontend:
    st.audio(audio.tobytes())
    
    # To save audio to a file:
    wav_file = open("audio.mp3", "wb")
    wav_file.write(audio.tobytes())

About

Audio recorder for streamlit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 41.3%
  • Python 37.6%
  • HTML 17.6%
  • Shell 3.5%