blog/content/posts/20210325_sound-analysis-on-...

5.3 KiB
Executable File

title author date tags lang
Analyse Sound on GNU/Linux using Wine Samuel Ortion 2021-03-25
audio
bat
bird
ultrasound
syrinx
batsound
en

After recording bats, orthoptera or birds, it is often necesserary to see the spectrograms of the sounds, for instance while analysing Vigie-Chiro Program bat records

The software needed to do so are often only for Windows, in the present article, we will learn how to install these softwares (i.e. Kaleidoscope, Syrinx, Batsound 4, 7-zip, Lupas-Rename).

Install Wine

Wine is a software that enable .exe software to run on UNIX systems such as Linux or Mac OS.

On Debian and derivatives (Ubuntu...)

Enable 32 bit packages (if you haven't already):

sudo dpkg --add-architecture i386

Download and install the repository key:

wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key

Add the repository to /etc/apt/sources.list or create a wine.list under /etc/apt/sources.list.d/ with the following content:

deb https://dl.winehq.org/wine-builds/debian/ buster main 

Update packages

sudo apt update

Install Wine stable

sudo apt install --install-recommends winehq-stable

On Fedora, RHEL, and derivatives

Add repository :

dnf config-manager --add-repo https://dl.winehq.org/wine-builds/fedora/33/winehq.repo

Install stable package :

dnf install winehq-stable

Install Kaleidoscope

Kaleidoscope is available on both fedora and debian based distros at wildlife acoustics.

Install Syrinx

As all following softwares, Syrinx is not available for GNU/Linux, we need Wine to execute the .exe. Syrinx-PC is available at Google Drive. You will also need the config files available at Google Drive.

You have almost two options : You can either right click on the .exe installer and select Open with other application and Wine Windows Program Loader, or either run wine syrinxalphainst.exe in Terminal.

Set up app launcher

You have to create a new file .local/share/applications/syrinx.desktop:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Syrinx
Comment=Acoustic analysis
Exec=/usr/bin/wine /home/<USER>/.wine/drive_c/Program\ Files\ (x86)/syrinx/Syrinx.exe
Icon=/home/<USER>/.wine/drive_c/Program Files (x86)/syrinx/img/vigie-chiro.png
Terminal=false

Change <USER> by your username. To have the icon, you can download vigie-chiro.png. To analyse ultrasound, with a 384 kHz sampling frequency, we have to open Configs_syrinx/exp384.dsp; and next Load sound file (Ctrl+L). To switch to other sound file in same folder, we can use alt+arrows. For more tips, you can view the video of Charlotte ROEMER (Fr).

Install and Configure Batsound 4

The procedure is quite similar with Syrinx-PC installation.

Set up app launcher

Create a new file .local/share/applications/batsound.desktop:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Batsound
Comment=Acoustic analysis
Exec=/usr/bin/wine /home/<USER>/.wine/drive_c/Program\ Files\ (x86)/Pettersson/Batsound4/BatSound.exe
Icon=/home/<USER>/.wine/drive_c/Program Files (x86)/Pettersson/Batsound4/img/batsound.png
Terminal=false

(Do not forget to change <USER> to your username.)

To have the icon, you can download batsound.png.

Configure Batsound to analyse ultrasounds

  • Enter the Sound/Sound Format menu.

Entering Sound/Sound Forma menu

  • Change Time expansion value to 10 (according to your recorder settings)

  • Keep 44 100 as Samples per second value.

  • Enter the Analysis/Spectrogram Settings - Defaults menu.

Entering Spectrogram Setting - Defaults menu

  • Change Max frequency to 150000;

  • Set Amplitude color mapping to Yellow, Red & Blue;

  • Adapt Threshold to sound intensity.

  • You can zoom in.

With a Pipistrellus kuhlii record, I obtain the following spectrogram with the above settings : pipkuh spectro

Install 7-zip

7-zip is useful in Vigie-Chiro process to compress audio files for faster upload to https://vigiechiro.herokuapp.com.

  1. Download .exe installer at https://www.7-zip.org/
  2. Execute 7z1900.exe with wine.

Install Lupas-Rename

Lupas-Rename is used in Vigie-Chiro protocole to batch rename audio file to add protocoles informations such as pass and square.

  1. Dowload .exe installer at https://rename.lupasfreeware.org/download.php
  2. Execute installer with wine
  3. Batch rename audio files...

Conclusion

With all these functionnal softwares, you are able to perform Vigie-Chiro protocole and sound analysis on GNU/Linux. I look forward to see your participation at https://vigiechiro.herokuapp.com !