Skip to main content

Python wrapper for SignaVis Player (HTML/Streamlit embedding)

Project description

signavis (Python wrapper)

SignaVis Screenshot

PyPI GitHub stars

Python package to embed the SignaVis DAW player in Streamlit, Jupyter, Gradio, and any HTML-capable UI. Supports waveform & spectrogram visualization, annotation, and custom player layouts.

Live demo: https://limitlessgreen.github.io/SignaVis/


Installation

pip install signavis

Optional for demos:

pip install "signavis[streamlit]"
pip install "signavis[gradio]"

Example: Load and Display Your Own Audio

You can load your own audio file (WAV, MP3, etc.) and display it as a spectrogram or waveform in any supported environment. Just read the file as bytes and pass it to render_daw_player:

Jupyter Notebook:

from signavis import render_daw_player

with open("your_audio.wav", "rb") as f:
    audio_bytes = f.read()

html = render_daw_player(audio_bytes, viewMode="spectrogram")

# Display in Jupyter:
from IPython.display import HTML
HTML(html)

Streamlit:

import streamlit as st
from signavis import render_daw_player
import streamlit.components.v1 as components

uploaded = st.file_uploader("Choose an audio file", type=["wav", "mp3", "ogg", "flac"])
if uploaded is not None:
    html = render_daw_player(uploaded.read(), viewMode="spectrogram")
    components.html(html, height=620, scrolling=False)

You can use all other options as described above to customize the player.

Quickstart

Embed a DAW player for your own audio in Streamlit, Jupyter, or any HTML UI:

from signavis import render_daw_player
html = render_daw_player(
        audio_bytes,  # bytes (WAV/MP3)
        viewMode="spectrogram",   # 'both' | 'waveform' | 'spectrogram'
        transportStyle="hero",    # 'default' | 'hero'
        showOverview=False,        # Hide overview navigator
        showFileOpen=False,        # Hide file open button
        showStatusbar=False,       # Hide status bar
        labelTaxonomy=[{"name": "Species", "color": "#0ea5e9"}],
        # ...any other BirdNETPlayer option
)

Display in Streamlit:

import streamlit.components.v1 as components
components.html(html, height=620, scrolling=False)

Display in Jupyter:

from IPython.display import HTML
HTML(html)

Player Options

Option Example Description
viewMode 'spectrogram' Show only the spectrogram
transportStyle 'hero' Large centered play button
showOverview False Hide overview navigator
showFileOpen False Hide file open button
showStatusbar False Hide status bar
labelTaxonomy [{'name': 'Species', 'color': '#0ea5e9'}] Custom label presets
iframe_height 320 Set iframe height (default: 620)

For all options, see the Web API docs.


Presets & Layouts

The package includes several ready-to-use presets (see demo_streamlit.py):

  • Full DAW: All controls, waveform & spectrogram, annotation
  • Compact: Minimal controls, no overview/statusbar
  • Preview Waveform Hero: Large play button, waveform only
  • Preview Spectrogram Hero: Large play button, spectrogram only
  • Ultra Compact Hero: Smallest possible embed

You can combine or override any option for your use case.


Advanced: Custom Spectrograms

You can inject your own pre-computed spectrogram data or images:

  • spectrogram_data: 2D numpy array (nFrames × nMels, float32)
  • spectrogram_image: PNG/JPEG bytes, data-URL, matplotlib Figure, PIL Image, or numpy uint8 array

See the Web API for details.


Demos

Streamlit:

streamlit run demo_streamlit.py

Gradio:

pip install gradio
python demo_gradio.py

Google Colab:

Open In Colab

Try the interactive notebook demo directly in your browser—no setup required!


License

GNU AGPL-3.0

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

signavis-0.7.4.tar.gz (185.9 kB view details)

Uploaded Source

Built Distribution

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

signavis-0.7.4-py3-none-any.whl (183.2 kB view details)

Uploaded Python 3

File details

Details for the file signavis-0.7.4.tar.gz.

File metadata

  • Download URL: signavis-0.7.4.tar.gz
  • Upload date:
  • Size: 185.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for signavis-0.7.4.tar.gz
Algorithm Hash digest
SHA256 e7e0c356f0c20eb07d5c2b04afb21fde4572e1a609a6db6cd356fb8fb4027b48
MD5 e82bd74efaaeab938fdbf3b48c8517bb
BLAKE2b-256 eacfc61525e41b18040e79949e4266aed96f9492ef444a7fa43c36e082836bdc

See more details on using hashes here.

File details

Details for the file signavis-0.7.4-py3-none-any.whl.

File metadata

  • Download URL: signavis-0.7.4-py3-none-any.whl
  • Upload date:
  • Size: 183.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for signavis-0.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e6a0796f76c7bc9a661bdc3c7e664610e3468c6b4825e734ce3f33eef0932a7d
MD5 a004de636b15f00baa74bbd6bbaf1259
BLAKE2b-256 3581b7b9254ea79520666b047440d209bced01616a6f421c226a8b263c8bcfcb

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