shira 🔖🎧
A simple audio search/retrieval library. (wip)
This is the audio version of ripple.
Search through audio files/data with text queries or audio samples.
It's meant to be an neural encoded version of Shazam, but might just be for small scale/local usage.
Methodology
It's basically a semantic search library for audio.
The local audio data/files are indexed and embeddings are generated(with CLAP),
then a FAISS vector index is created.
The files are retrieved based on cosine similarity between embeddings.
(it could also be adapted for audio recommendation).
This process makes use of contrastively pretrained audio-language model, CLAP(like OpenAI CLIP for audio), specifically LAION's laion/larger_clap_music_and_speech checkpoint/model.
usage
- Install the library
pip install shira-audio
- For text-based search
from shira import AudioSearch, AudioEmbedding
embedder = AudioEmbedding(data_path='.') # init embedder class
audio_data_embeds = embedder.index_files() # create embeddings and index audio files
neural_search = AudioSearch() # init semantic search class
text_query = 'classical music' # text description for search
# get k similar audio w/probability score pairs
matching_samples, scores = neural_search.text_search(text_query, audio_data_embeds, k_count=5)
matching_samples['path'][0], scores[0] # get file path for the top sample
Or you could use it from your terminal:
# -t for text query
# --dir for [optional] target directory
shira_text -t instrumental --dir downloads/music
- For audio-based search
from shira import AudioSearch, AudioEmbedding
embedder = AudioEmbedding(data_path='downloads') # init embedder class
audio_data_embeds = embedder.index_files() # create embeddings and index audio files
neural_search = AudioSearch() # init semantic search class
audiofile = 'beethoven_moonlight_sonata.mp3' # audio file for reference
# get k similar audio w/probability score pairs
similar_samples, scores = neural_search.audio_search(audiofile, audio_data_embeds, k_count=4)
similar_samples['path'][0], scores[0] # get file path for the top sample
Or for terminal/cli use:
# -f reference audio file path
# --dir for [optional] target directory
shira -f sprinter.mp3 --dir downloads/
Acknowldgements
Metadata
Release files for shira-audio 0.1.292
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shira_audio-0.1.292.tar.gz | 324.7 kB | Without provenance | Details for shira_audio-0.1.292.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| shira_audio-0.1.292-py3-none-any.whl | Python 3 | none | any | Details for shira_audio-0.1.292-py3-none-any.whl |
Total release size: 340.1 kB
Release files / shira_audio-0.1.292.tar.gz
| Download URL | shira_audio-0.1.292.tar.gz |
|---|---|
| Size | 324.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bfa0e472b969b8ecad79157cc598aa12455e6c76f6fc4b8e66a5957a8481c3f4
|
|
BLAKE2b-256 checksum How to use checksums |
f08964d0bc7040424d9f81d0c074d7c4bb2dccb729810ec24ee1eb559ae8da35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / shira_audio-0.1.292-py3-none-any.whl
| Download URL | shira_audio-0.1.292-py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f8a1d02fc6a86e02de970a6edf20b94a618239880bb1fbfa3a783fae83cf6b9
|
|
BLAKE2b-256 checksum How to use checksums |
7edae1b5fb82baaf78ace23ef3cea57fcf36c4a9b3d720745183a49c7350c51b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for shira-audio 0.1.292
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.