Skip to main content

audio search/retrieval library

Project description

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

Acknowldgements

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

shira_audio-0.1.27.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

shira_audio-0.1.27-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file shira_audio-0.1.27.tar.gz.

File metadata

  • Download URL: shira_audio-0.1.27.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for shira_audio-0.1.27.tar.gz
Algorithm Hash digest
SHA256 9aa6a7ef0389c6807531cf47ec4e61d7f5e58946f9b50017768789e6c928f348
MD5 6c21d143827875a363aa16c4693cf3ec
BLAKE2b-256 1a564966c0993425d4ecfb54d04a66d0d1ec4746839a2d50e56ea4a0bd02e5a3

See more details on using hashes here.

File details

Details for the file shira_audio-0.1.27-py3-none-any.whl.

File metadata

  • Download URL: shira_audio-0.1.27-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for shira_audio-0.1.27-py3-none-any.whl
Algorithm Hash digest
SHA256 340faaadfcbafde2cdf26efc5bb7cf12ffc6055b14a8c949c4636e791dd7e423
MD5 f54c14deb92e25b0745a816f52317f7f
BLAKE2b-256 3f37523b891dff7b9b4da8c6e9447e728daadba4512af25313104756b5956567

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page