Learn R Programming

ohun: optimizing sound event detection

ohun is intended to facilitate the automated detection of sound events, providing functions to diagnose and optimize detection routines. It provides utilities for comparing detection and annotations of audio events described by frequency and time boxes.

The main features of the package are:

  • The use of reference annotations for detection diagnostic and optimization
  • The use of signal detection theory indices to evaluate detection performance

The package offers functions for:

  • Curate references and acoustic data sets
  • Diagnose detection performance
  • Optimize detection routines based on reference annotations
  • Energy-based detection
  • Template-based detection

The implementation of detection diagnostics that can be applied to both built in detection methods and to those obtained from other software packages makes the package ohun an useful tool for conducting direct comparisons of the performance of different routines. In addition, the compatibility of ohun with data formats already used by other sound analysis R packages (e.g. seewave, warbleR) enables the integration of ohun into more complex acoustic analysis workflows in a popular programming environment within the research community.

All functions allow the parallelization of tasks (using the packages parallel and pbapply), which distributes the tasks among several processors to improve computational efficiency. The package works on sound files in ‘.wav’, ‘.mp3’, ‘.flac’ and ‘.wac’ format.

Install/load the package from CRAN as follows:

# From CRAN would be
install.packages("ohun")

#load package
library(ohun)

To install the latest developmental version from github you will need the R package remotes:

remotes::install_github("ropensci/ohun")

#load package
library(ohun)

Further system requirements due to the dependency seewave may be needed. Take a look a this link for instruction on how to install/troubleshoot these external dependencies.

Take a look at the vignettes for an overview of the main features of the packages:

This package has been peer-reviewed by rOpenSci.


Please cite ohun as follows:

Araya-Salas, M. (2022), ohun: diagnosing and optimizing automated sound event detection. R package version 0.1.1.

Copy Link

Version

Install

install.packages('ohun')

Monthly Downloads

453

Version

1.0.3

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Marcelo Araya-Salas

Last Published

July 22nd, 2025

Functions in ohun (1.0.3)

lbh2

Long-billed hermit recording
print.template_correlations

print method for class template_correlations
optimize_template_detector

Optimize acoustic template detection
lbh_reference

Example data frame of a selection table including all sound events of interests
lbh1

Long-billed hermit recording
print.envelopes

Class 'envelopes': list of absolute amplitude envelopes
plot_detection

Plot detection and reference annotations
reassemble_detection

Reassemble annotations from clips
split_acoustic_data

Splits sound files and associated annotations
ohun

ohun: Optimizing sound event detection
optimize_energy_detector

Optimize energy-based sound event detection
summarize_diagnostic

Summarize detection diagnostics
summarize_acoustic_data

Summarize information about file format in an acoustic data set
merge_overlaps

Merge overlapping selections
template_detector

Acoustic template detection from time-frequency cross-correlations
summarize_reference

Summarize temporal and frequency dimensions of annotations and gaps
template_correlator

Acoustic templates correlator using time-frequency cross-correlation
energy_detector

Detects the start and end of sound events
diagnose_detection

Evaluate the performance of a sound event detection procedure
consensus_detection

Remove ambiguous detections
feature_acoustic_data

alternative name for summarize_acoustic_data
label_detection

Label detections from a sound event detection procedure
feature_reference

alternative name for summarize_reference
filter_detection

alternative name for consensus_detection
label_spectro

Plot a labeled spectrogram
get_envelopes

Extract absolute amplitude envelopes
get_templates

Find templates representative of the structural variation of sound events