Function Repository Resource:

AnimalSound

Source Notebook

Import sounds produced by animals

Contributed by: Keiko Hirayama

ResourceFunction["AnimalSound"][species]

generates an Audio object associated with a specified species entity.

ResourceFunction["AnimalSound"][species,property]

gives a property of an audio object for a specified species entity.

Details and Options

ResourceFunction["AnimalSound"] returns an Audio object associated with animals. Sounds include the vocalization and other noises produced by animals for communication.
Selected "TaxonomicSpecies" entities can be used.
Supported values of property include the following:
"Channels"number of audio channels
"Duration"duration of the audio track
"SampleRate"the sampling rate
"Link"URL to the sample Audio object
ResourceFunction["AnimalSound"] has the same options as Audio.

Examples

Basic Examples (2) 

Explore the vocal sound of animals:

In[1]:=
ResourceFunction["AnimalSound"][
 Entity["TaxonomicSpecies", "PantheraLeo::d7933"]]
Out[1]=

Explore noises produced by animals:

In[2]:=
ResourceFunction["AnimalSound"][
 Entity["TaxonomicSpecies", "AmphipsaltaZelandica::597m6"]]
Out[2]=

Scope (1) 

Explore a property of the audio object:

In[3]:=
ResourceFunction["AnimalSound"][
 Entity["TaxonomicSpecies", "OophagaPumilio::9y4sw"], "Duration"]
Out[3]=

Options (1) 

Specify a sample rate:

In[4]:=
ResourceFunction["AnimalSound"][
 Entity["TaxonomicSpecies", "GryllotalpaGryllotalpa::5p583"], SampleRate -> 22050]
Out[4]=

Applications (3) 

Use AudioIntervals to compute intervals of the animal calls:

In[5]:=
audio = ResourceFunction["AnimalSound"][
  Entity["TaxonomicSpecies", "LeptodactylusMystacinus::wdr3m"]]
Out[5]=
In[6]:=
int = AudioIntervals[audio, "Inaudible"]
Out[6]=

Analyze the interval durations:

In[7]:=
Histogram[Differences /@ int // Flatten]
Out[7]=

Visualize intervals:

In[8]:=
AudioPlot[audio, Epilog -> {Directive[Orange, Opacity[.3]], Rectangle[{#[[1]], -.3}, {#[[2]], .3}] & /@ int}, PlotRange -> Full, ImageSize -> 500]
Out[8]=

Possible Issues (1) 

Audio information is available for selected animal species only. Trying to visualize a non-animal species entity returns a Missing value:

In[9]:=
ResourceFunction["AnimalSound"][
 Entity["TaxonomicSpecies", "Genus:Amoeba"]]
Out[9]=

Neat Examples (1) 

Use FeatureSpacePlot to visualize the features extracted from the bird vocalization:

In[10]:=
birds = {Entity["TaxonomicSpecies", "CorvusCornix::f283t"], Entity["TaxonomicSpecies", "StreptopeliaDecaocto::438y6"], Entity["TaxonomicSpecies", "AcanthizaLineata::82nk4"], Entity["TaxonomicSpecies", "AccipiterCooperii::532m2"], Entity["TaxonomicSpecies", "AegoliusFunereus::53zk3"], Entity["TaxonomicSpecies", "CygnusColumbianus::9762j"], Entity["TaxonomicSpecies", "ChroicocephalusRidibundus::c5x92"], Entity["TaxonomicSpecies", "CuculusCanorus::sr29m"], Entity["TaxonomicSpecies", "AcrocephalusBaeticatus::cjcw9"], Entity["TaxonomicSpecies", "GarrulusGlandarius::9937v"], Entity["TaxonomicSpecies", "MegascopsCholiba::79fgm"], Entity["TaxonomicSpecies", "PandionHaliaetus::8vwn9"], Entity["TaxonomicSpecies", "OriolusOriolus::tdyt6"], Entity["TaxonomicSpecies", "DryocopusPileatus::mz955"], Entity["TaxonomicSpecies", "ArchilochusAlexandri::5396r"]};
In[11]:=
FeatureSpacePlot[
 ResourceFunction["AnimalSound"][#] -> Column[{#, ImageResize[#["Image"], 60]}] & /@ birds, LabelingFunction -> Callout, ImageSize -> 600]
Out[11]=

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.0.0 – 03 January 2024

Source Metadata

Related Resources

License Information