Skip to main content

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
overviewMode 'spectrogram' Overview shows the whole spectrogram instead of the waveform
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

Gradio Blocks (native component):

signavis.gradio.SignaVisPlayer is a real Gradio 6 component: the player, its stylesheet and WaveSurfer are served from this package (works offline), and the audio is streamed from disk instead of being inlined, so hour-long recordings stay cheap. Detections are drawn as read-only labels; selecting one scrolls to and plays it.

import gradio as gr
from signavis.gradio import SignaVisPlayer, player_value

with gr.Blocks() as demo:
    player = SignaVisPlayer()
    gr.Button("Show").click(
        lambda: player_value(
            "bird.wav",
            detections=[{"start": 3, "end": 6, "label": "Turdus merula", "confidence": 0.91}],
            select=(3, 6),  # optional: jump there and play it
        ),
        outputs=player,
    )

Google Colab:

Open In Colab

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


License

This Python package, including the bundled player assets, is available under your choice of the MIT License (LICENSE-MIT) or the GNU AGPL-3.0 (LICENSE). The bundled WaveSurfer.js is BSD-3-Clause (signavis/assets/wavesurfer.LICENSE.txt). The Rust crates compiled into the DSP WebAssembly module are under permissive licenses (MIT, Apache-2.0, BSD, Unicode-3.0, Unlicense); their texts are in signavis/assets/aw_dsp_wasm.THIRD_PARTY_LICENSES.txt.

Metadata

Release files for signavis 1.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for signavis 1.4.3
File Size Uploaded Provenance Actions
signavis-1.4.3.tar.gz 479.8 kB Without provenance Details for signavis-1.4.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for signavis 1.4.3
File Interpreter ABI Platform Actions
signavis-1.4.3-py3-none-any.whl Python 3 none any Details for signavis-1.4.3-py3-none-any.whl

Total release size: 957.1 kB

Release files / signavis-1.4.3.tar.gz

Download URL signavis-1.4.3.tar.gz
Size 479.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4aab9e11a5a36c0d69d10bbf4cfe88d62738b859ff29c10c9ee4e7f441dff8f9
BLAKE2b-256 checksum
How to use checksums
22062363684ae9e27e754575ea6c3319190df24e3937ac0bf449d7a90f74c873
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / signavis-1.4.3-py3-none-any.whl

Download URL signavis-1.4.3-py3-none-any.whl
Size 477.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ba86012b262bc7e1456e93bee43590c2bfb111be127cd5ed07580aa54f634b6
BLAKE2b-256 checksum
How to use checksums
81157314a6f021f7915e59d90b0e3c3c0b2e403a5294737c19bfbce686107bee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Security for signavis 1.4.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page