NINAnor / acoustic_indices_compute

Utils scripts to compute acoustic indices + VGGish features from audio files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compute acoustic indices

This repository contains a minimal wrapper around Maad where the user only has to input a list of files and the script outputs a dataframe of indices for each acoustic file analyzed.

Note that the code makes use of fsspec so that the analysis can be done on files from a remote server.

How to use the scripts

Install the dependancies:

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Run the script for single files

If you want to obtain the acoustic indices for your files:

python3 compute_indices.py filecache::ssh://user:password@host/device/2022-10-24T19_36_53.317Z.mp3 

If you want to compute the VGGish features for your audio files:

python3 vggish_embeddings.py filecache::ssh://user:password@host/device/2022-10-24T19_36_53.317Z.mp3 

Run the script for multiple files in parallel

sudo apt-get install parallel
    1. List the files you want to analyze in a files_to_analyze.csv file in the form:
filename
filecache::ssh://user:password@host/device/2022-10-24T19_36_53.317Z.mp3
filecache::ssh://user:password@host/device/2022-10-24T19_01_36.412Z.mp3
filecache::ssh://user:password@host/device/2022-10-24T11_07_50.161Z.mp3
    1. Run the run_parallel_indices.sh or the run_parallel_embeddings.sh:
./run_parallel_indices.sh
    1. Get the results

Using the run_parallel_indices.sh you should find the results stored in an output.txt file

⭐ Note if the computation crashes, GNU parallel is able to resume the computation where it stopped.

About

Utils scripts to compute acoustic indices + VGGish features from audio files


Languages

Language:Python 90.1%Language:Shell 9.9%