Skip to main content

Beautiful audio stream player component for Streamlit with frequency visualization and state animations

Project description

Streamlit Audio Stream Player

Beautiful audio stream player component for Streamlit with frequency visualization and animated state transitions, inspired by ElevenLabs UI design.

Demo

License Python

Installation

pip install streamlit-audio-stream-player

Quick Start

import streamlit as st
from streamlit_audio_stream_player import audio_stream_player
import time

st.title("🎵 Audio Stream Player Test")

# Session state
if 'play_count' not in st.session_state:
    st.session_state.play_count = 0

# Audio stream options
stream_options = {
    "Radio Paradise (MP3)": "https://stream.radioparadise.com/mp3-128",
    "BBC World Service": "https://stream.live.vc.bbcmedia.co.uk/bbc_world_service",
    "Custom URL": "custom"
}

selected_stream = st.selectbox("Select Audio Stream", list(stream_options.keys()))

if selected_stream == "Custom URL":
    stream_url = st.text_input("Enter Audio Stream URL", value="https://stream.radioparadise.com/mp3-128")
else:
    stream_url = stream_options[selected_stream]

st.info(f"🎧 Current Audio Stream: {stream_url}")

# Display audio stream player
if stream_url:
    audio_stream_player(
        stream_url=stream_url,
        key=f"player_{st.session_state.play_count}"
    )
    
st.markdown("---")
st.caption("💡 Tip: If you don't hear sound, check the browser console (F12) for error messages and verify the audio stream URL is valid.")

⚠️ Browser Compatibility Warning: Safari may have issues with audio streaming due to CORS restrictions. For best results, use Chrome or Firefox.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit_audio_stream_player-0.2.0.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_audio_stream_player-0.2.0-py3-none-any.whl (99.0 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_audio_stream_player-0.2.0.tar.gz.

File metadata

File hashes

Hashes for streamlit_audio_stream_player-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3aa699aa281f3cb3b56c6e3191e89dd947a85a1221dcc11fa26c56ef49893110
MD5 36ef2a2e1f40aa8e9899b3f2e3e89ae6
BLAKE2b-256 ea02a4b391535890807d5a943c3fc7900d7641ab394d2fafe46ce76804ac3b6b

See more details on using hashes here.

File details

Details for the file streamlit_audio_stream_player-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_audio_stream_player-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 165d14b31a15edfb1c2e6b89cb7aade68ac81601ca079407c0572def1dfde12a
MD5 5ac60c395c6baba9db79dad6fea62b73
BLAKE2b-256 78c7c4e933fb45041e2a1f1bbb3e61498bc16c769900e82017c2ae028a7e4861

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page