Skip to main content

Turn audio into structured analysis and annotated visualizations for AI perception

Project description

sense-music

Turn audio into structured analysis and annotated visualizations for AI perception. Liner notes for an AI.

Built by humanjava.com — find this and other tools for the agentic age at huje.tools.

Install

pip install sense-music

v0.1.6 — coordinated 2026-07 correctness release (version-drift reconciliation, staged pending PyPI publish). Converges the repo with PyPI 0.1.5: keeps the SSRF redirect + DNS-rebinding hardening of analyze() URL fetching (per-hop address checks, DNS pinning, redirect cap, streamed size cap) and folds in 0.1.5's error-message info-disclosure hardening (no path/URI leaks in errors). See CHANGELOG.md.

Quick Start

from sense_music import analyze

result = analyze("song.mp3")
print(result.summary)
result.save("output/")

Full Example

from sense_music import analyze

result = analyze("song.mp3")

# Structured data
print(f"{result.bpm.tempo} BPM, {result.key.key} {result.key.mode}")
print(f"Genre: {result.genre}, Mood: {', '.join(result.mood)}")

# Sections
for s in result.sections:
    print(f"  {s.label}: {s.start:.1f}s — {s.end:.1f}s")

# Lyrics (requires whisper)
for line in result.lyrics:
    print(f"  [{line.start:.1f}s] {line.text}")

# Save everything
result.save("output/")           # spectrogram.png, waveform.png, analysis.json, analysis.html
result.render_page("song.html")  # self-contained HTML report

Skip Lyrics

If you don't have Whisper installed or want faster analysis:

result = analyze("song.mp3", lyrics=False)

What You Get

Output Description
result.spectrogram PIL Image — annotated mel spectrogram with section markers and energy curve
result.waveform PIL Image — waveform with colored section regions
result.bpm BPMInfo(tempo, confidence)
result.key KeyInfo(key, mode, confidence)
result.sections List of Section(label, start, end)
result.lyrics List of LyricLine(start, end, text)
result.energy_curve Per-second normalized energy values
result.genre Simple genre classification
result.mood List of mood descriptors
result.summary Natural language track description

Dependencies

Usage & Copyright

You are responsible for ensuring you have the legal right to analyze any audio you submit to this tool, whether running locally or via the hosted service at huje.tools. sense-music provides compute and analysis only — it does not store, host, or redistribute audio content. By using this tool, you accept full responsibility for the content you process and how you use the results.

For details, see huje.tools/support.

License

MIT — Humanjava Enterprises Inc.

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

sense_music-0.1.6.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

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

sense_music-0.1.6-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file sense_music-0.1.6.tar.gz.

File metadata

  • Download URL: sense_music-0.1.6.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sense_music-0.1.6.tar.gz
Algorithm Hash digest
SHA256 3a55eea387fa25425e753b85d7c8218d9019a6bfa6ff8db0011e70e07ba3ca2a
MD5 8a2de0535d9ebeea78d99e077b4f79af
BLAKE2b-256 68a36eeccdf87d39cc321506212eb4f295acea628d5ad3fcaf19664049117f95

See more details on using hashes here.

File details

Details for the file sense_music-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: sense_music-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sense_music-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a0a79f16821ed21dc2eda62712da7349da5a0f73d4d836b15f21d6bd77ab44ca
MD5 d6f76ef7c92abbc531fe4d23d9ccbdde
BLAKE2b-256 c117d473493149e7286f517f5246ec1a24cb63b7677b96092f3696e850cf35f8

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