Category Archives: Bioacoustics

Compressing audio files without loosing data

FLAC Compression

High quality audio files take a lot of space, for example, a 1 minute stereo sound at CD-quality (44.1 kHz) will take about 10-11 Mb. A large collection of sound files will fill hard drives really fast. The usual solution to this problem is to compress the files, however each compression system has its limitations.

The common zip compression format works well for text but does not compress audio in any significant degree. Encoding the file to mp3 will destroy a lot of information that will be necessary to analyze the audio.

FLAC (Free Lossless Audio Codec) is optimized for wav audio files, and can compress a wav to 30-50% of its original size. It appears that the amount of compression will depend on the complexity of the sound recorded. The decoding back to wav is very fast and it is an exact copy of the original file. read more »

Digital recorders increase detection of Eleutherodactylus frogs

I am posting the paper and the data associated with this paper:

Villanueva-Rivera, L. J. 2007. Digital recorders increase detection of Eleutherodactylus frogs. Herpetological Review 38: 59-63. PDF.

Read the readme.txt file in each zip archive for details.

Sound Viewer Tool – a fast Python script to get waveform and spectrogram from a sound

This script uses the numpy and audiolab modules to generate waveform and spectrogram png images from a wav file. The original script was from the Freesound Blog. The wav file needs to be 16 bit, mono and have a sampling rate of 44.1 kHz. The script takes about 2-3 seconds for a 60 seconds file (on a Core2 Duo 2GHz, 2GB RAM machine).

Update: The script is now a project on SourceForge: http://sourceforge.net/projects/soundviewer/

read more »

Make MP3 files from FLAC

This Bash script will extract the wav from each FLAC in the folder and create an MP3 in the mp3/ folder.

  1. #!/bin/bash
  2. #
  3. # wav2mp3
  4. #
  5. for i in *.flac; do
  6.     # The 192 is the bitrate
  7.     flac -d $i
  8.     lame -h -b 192 ${i%.flac}.wav mp3/${i%.flac}.mp3
  9.     rm ${i%.flac}.wav
  10. done

A short list of audio software

Free and open source audio software

  • Audacity – The Free, Cross-Platform Sound Editor. Windows, Mac OS X, Linux and others.
  • R – R is a free software environment for statistical computing and graphics. Two packages allow to load and analyze sound files: sound and seewave. Windows, Mac OS X, Linux, and others.
  • Raven Lite – Free version of Raven Pro. Limited to some visualizations, formats, and time. Windows and Mac OS X.

Commercial Audio Software

  • Adobe Audition – Professional studio application. Allows to visualize, edit and mix many audio formats. Windows only.
  • Raven Pro – Audio analysis program from the Cornell Lab of Ornithology. Windows and Mac OS X.
  • Apple Logic Studio – Professional studio application. Mac OS X only.

Visualize a sound file using R

One common way to work with sound files is to generate the spectrum of the sound. With this example you will be able to open a wav file and see its spectrogram. read more »

SoX

Sox is “the swiss army knife of sound processing programs”.

To convert a stereo file to mono:

  1. sox stereo.wav -c 1 mono.wav

Check the SoX website for more options.

Page 2 of 212