foley
Find (or generate) the right sound effect for a moment of narration — and weave it in.
foley is a retrieval-first façade for sound effects: one simple surface over many sound sources (your own library, service APIs, and generative-AI models), a searchable index of every sound (by keyword and meaning), an agent that picks the right sound for a narrative context, and a compositor that places it under the voice.
It's the SFX sibling of arioso (a unified
façade over AI music-generation backends): same discipline — one entry function,
config-driven plugin adapters, a unified vocabulary translated per-backend, zero
required core deps with lazy optional-deps — but centered on search rather than
generation, with generation as just one of several sources.
Status: v1. All four stages — source, index, select, weave — plus the MCP server and the licensing/provenance, evaluation, and observability layers are implemented (Epic #13 complete). The API below is live; see the roadmap for what's next. Follow along in
misc/docs/.
The idea
import foley
# The headline — right sounds for a narrative context:
# decompose the passage into salient sound events → search → verify → decide
candidates = foley.find("She pushed open the heavy oak door; rain hammered outside.")
# Direct hybrid search of your library (text query or a reference clip)
hits = foley.search("distant thunder rumble", k=10, commercial_ok=True)
# Generate a sound when nothing fits (arioso-style; pluggable backends)
clip = foley.generate("a single wooden door creak", backend="stable_audio", duration=3)
# Grow the library — ingest auto-tags, captions, and embeds every file
foley.ingest("~/my_sounds/")
foley.add_from("freesound", query="ocean waves", license="cc0")
# Compose: place the sounds under the narration (find → plan → weave)
timeline = foley.plan(candidates) # the editable sound-design plan
result = foley.weave("narration.wav", timeline) # mastered mix + SDH captions + credits
How it works — four stages
| Stage | What it does | Built on |
|---|---|---|
| Source | your own files · Freesound (CC0) · generate (Stable Audio Open / ElevenLabs) | config-driven adapters, per-sound license tracking |
| Index | probe → tag → caption → embed every sound; hybrid keyword+semantic search | PANNs · CLAP · EnCLAP · LanceDB (local→cloud via dol) |
| Select | decompose a narrative context → search → verify → generate-or-retrieve | CLAP retrieval + LLM decomposition + a verification ladder |
| Weave | align to the voice, duck, place, master → mastered mix + editable timeline + captions + credits | forced-alignment · LUFS/EBU-R128 |
The selection tools publish as an MCP server (via py2mcp) so the same capabilities
drive the agent, a CLI, and external hosts.
Design & research
foley's design is grounded in five research reports (unified, cited):
- Design · Roadmap
- Research reports — sound sources, SFX generation, recognition/ tagging, embeddings/indexing, and the context-retrieval agent
- Deep-research prompt library — 12 ready-to-run prompts covering every dimension of the project
Install
pip install foley
(Optional per-capability extras — foley[freesound], foley[clap], foley[stable-audio],
foley[index], … — are added as each subsystem lands.)
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file foley-0.0.19.tar.gz.
File metadata
- Download URL: foley-0.0.19.tar.gz
- Upload date:
- Size: 599.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c328fa2f70143235f2e9c887225494963433402629834528a3f285a6f3981d3
|
|
| MD5 |
d1512b46c61f23ac08461992bb73ff8f
|
|
| BLAKE2b-256 |
528e915dcf3b950cd9eec9bf714377e6bcef471d8c3a920c3d2ae5e4741fdf3b
|
File details
Details for the file foley-0.0.19-py3-none-any.whl.
File metadata
- Download URL: foley-0.0.19-py3-none-any.whl
- Upload date:
- Size: 373.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf75214e9d1bb711a0b6acfe0c06f24e09ca13a77a6c1d7e8849cfb181372669
|
|
| MD5 |
bff34054599adf69375104199b328c42
|
|
| BLAKE2b-256 |
a5581cf7d9285b783ed51369754c9dd16eeef0dd01c69e828a22c2ed156bf769
|