167 lines
5.7 KiB
Markdown
167 lines
5.7 KiB
Markdown
|
|
---
|
||
|
|
title: Analyse Sound on GNU/Linux using Wine
|
||
|
|
author: Samuel Ortion
|
||
|
|
date: 2021-03-25
|
||
|
|
modifdate: 2024-05-18
|
||
|
|
tags: [audio, bat, bird, ultrasound, syrinx, batsound]
|
||
|
|
lang: en
|
||
|
|
aliases: ["/analyse-sound-on-gnulinux-using-wine.html"]
|
||
|
|
slug: analyze-ultrasound-on-gnulinux-using-wine
|
||
|
|
---
|
||
|
|
|
||
|
|
After recording bats, orthoptera or birds sounds, it is often necessary to have a look at the spectrograms of the sounds, for instance while analyzing [Vigie-Chiro Program](http://www.vigienature.fr/fr/chauves-souris) bat records.
|
||
|
|
|
||
|
|
The software needed to do so are often developed only for Windows. In this article, we will learn how to install these softwares (e.g., Kaleidoscope, Syrinx, Batsound 4, 7-zip and Lupas-Rename).
|
||
|
|
|
||
|
|
_Une [version traduite en Français](/posts/analyser-des-sons-sur-gnulinux-avec-wine/) est disponible, avec quelques modifications_.
|
||
|
|
|
||
|
|
## 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):
|
||
|
|
|
||
|
|
```bash
|
||
|
|
sudo dpkg --add-architecture i386
|
||
|
|
```
|
||
|
|
|
||
|
|
Download and install the repository key:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
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` file under `/etc/apt/sources.list.d/` with the following content (recommended):
|
||
|
|
|
||
|
|
```textile
|
||
|
|
deb https://dl.winehq.org/wine-builds/debian/ buster main
|
||
|
|
```
|
||
|
|
|
||
|
|
Update packages
|
||
|
|
|
||
|
|
```bash
|
||
|
|
sudo apt update
|
||
|
|
```
|
||
|
|
|
||
|
|
Install Wine stable
|
||
|
|
|
||
|
|
```bash
|
||
|
|
sudo apt install --install-recommends winehq-stable
|
||
|
|
```
|
||
|
|
|
||
|
|
### On Fedora, RHEL, and derivatives
|
||
|
|
|
||
|
|
Add repository :
|
||
|
|
|
||
|
|
```bash
|
||
|
|
dnf config-manager --add-repo https://dl.winehq.org/wine-builds/fedora/33/winehq.repo
|
||
|
|
```
|
||
|
|
|
||
|
|
Install stable package :
|
||
|
|
|
||
|
|
```bash
|
||
|
|
dnf install winehq-stable
|
||
|
|
```
|
||
|
|
|
||
|
|
## Install Kaleidoscope
|
||
|
|
|
||
|
|
Kaleidoscope is available on both fedora and debian based distros at [wildlife acoustics](https://www.wildlifeacoustics.com/).
|
||
|
|
|
||
|
|
## Install Syrinx
|
||
|
|
|
||
|
|
As all the softwares in the following, Syrinx is not available for GNU/Linux, we need Wine to execute the `.exe`.
|
||
|
|
Syrinx-PC is available at [Google Drive](https://drive.google.com/file/d/0B5ZM90wrDzUOM0ZfYlpDR2l1cU0/view) (from the Vigie-Chiro program).
|
||
|
|
You will also need the config files available at [Google Drive](https://drive.google.com/file/d/0B5ZM90wrDzUOQnBhRjNVRFM1Rkk/view) too.
|
||
|
|
|
||
|
|
You have two options :
|
||
|
|
You can either right click on the `.exe` installer and select `Open with other application` and `Wine Windows Program Loader`, or run `wine syrinxalphainst.exe` in Terminal.
|
||
|
|
|
||
|
|
### Set up app launcher
|
||
|
|
|
||
|
|
You have to create a new file `.local/share/applications/syrinx.desktop`:
|
||
|
|
|
||
|
|
```textile
|
||
|
|
[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 unix username. To have an icon for the application launcher, you can download [`vigie-chiro.png`](/images/vigie-chiro.png).
|
||
|
|
|
||
|
|
To analyse ultrasound, with a 384 kHz sampling frequency, we have to open `Configs_syrinx/exp384.dsp`; and click on 'Load sound file' (shortcut `Ctrl+L`). To switch to other sound files in same folder, we can use `alt+arrows`. For more tips, you can view [the video of Charlotte ROEMER (Fr)](https://www.youtube.com/watch?v=BPPSw2FSLxs).
|
||
|
|
|
||
|
|
## Install and Configure Batsound 4
|
||
|
|
|
||
|
|
The procedure is quite similar with Syrinx-PC installation. We mention only key points.
|
||
|
|
|
||
|
|
### Set up app launcher
|
||
|
|
|
||
|
|
Create a new file `.local/share/applications/batsound.desktop`:
|
||
|
|
|
||
|
|
```textile
|
||
|
|
[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` with your username.)
|
||
|
|
|
||
|
|
To have an icon displayed in your application launcher, you can download [`batsound.png`](/images/batsound.png).
|
||
|
|
|
||
|
|
### Configure Batsound to analyse ultrasounds
|
||
|
|
|
||
|
|
- Enter the `Sound/Sound Format` 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.
|
||
|
|
|
||
|
|

|
||
|
|
|
||
|
|
- 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:
|
||
|
|

|
||
|
|
|
||
|
|
## Install 7-zip
|
||
|
|
|
||
|
|
7-zip is useful in Vigie-Chiro process to compress audio files for faster upload to [https://vigiechiro.herokuapp.com](https://vigiechiro.herokuapp.com).
|
||
|
|
|
||
|
|
1. Download `.exe` installer at [https://www.7-zip.org/](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. Download `.exe` installer at [https://rename.lupasfreeware.org/download.php](https://rename.lupasfreeware.org/download.php)
|
||
|
|
2. Execute installer with wine
|
||
|
|
3. Batch rename audio files...
|
||
|
|
|
||
|
|
## Conclusion
|
||
|
|
|
||
|
|
With all these softwares running on your Linux PC, you will be able to perform Vigie-Chiro protocole and sound analysis! I look forward to see your participations at <https://vigiechiro.herokuapp.com/>!
|
||
|
|
|
||
|
|
<!-- LocalWords: spectrograms
|
||
|
|
-->
|