audio

Naming a sound

Drop a file into the playground and it says in a word what the sound is: speech, music, birdsong, a clarinet, silence. A level, two trained networks and a rule choose that word. How they choose it, what it costs, and where it is wrong.

November 20268 min readFrom the playgroundReadings made 12 November 2026

01One word

The playground names what it is given: of this site's blackbird it says birdsong. (On the home page, where the blackbird plays, the page says that word of its own sound; of any other, the listeners below do.) The word is one of four kinds: silence; speech, music, or speech and music; a name from a list of 127, such as clarinet, rain or telephone; or no word at all.

Here are nine sounds this page holds or makes, and what the playground calls each.

FIG. 1.1Nine sounds and the word each gets, as readings.json records them. In full ink, what the playground listens to: the whole sound up to a minute, else six stretches of 10 s spread over it, as for the podcast. Under each word, who said it.

Three listeners stand in line. A level comes first and can only say silence. Then a network trained to tell speech from music. Where it has no word, a second network that scores 521 kinds of sound, and a rule that turns its scores into a word.

Of these nine, the level names one, the first network five, the second three. Two of those three are wrong: a 440 Hz tone is called a telephone, and white noise a waterfall. A voice made of three vowels, with no words in it, is called speech.

02Silence by level

If no sample reaches −70 dBFS, 0.000316 of full scale, the sound is silence, and neither network is asked. It is the cheapest test, and it is the only way the word silence is said.

The second network has a class called Silence, and it is not used. It gives that class to recordings that are quiet but not silent. DEMAND's recordings of places,9 at −37 to −56 dBFS RMS, score Silence 0.91 to 1.00: a park, a field, a hallway, a room with a washing machine running. A river bank scores 0.50. Said, every one of those would be wrong, so a quiet place gets no word.

03Speech or music

The first listener is the speech, music and noise network of inaSpeechSegmenter,5 made at Ina, France's national audiovisual institute. @audio/neural-denoise carries it to keep its denoisers off music, and from version 0.7 gives its reading as segments():7 782,403 weights, 1.56 MB as float16, inside the package.

It hears the sound at 16 kHz as 24 mel bands, keeps the lowest 21, and judges patches of 0.68 s, one every 100 ms, each scaled by its own mean and deviation so that loudness does not count. A Viterbi pass over the whole input joins the patches into segments. Changing kind costs so much there that a segment lasts a second or more.

import { segments } from '@audio/neural-denoise'

await segments(pcm, 44100)
// [{ kind: 'speech', start: 0, end: 8.1 }, { kind: 'music', start: 8.1, end: 12.9 }, { kind: 'noise', start: 12.9, end: 26 }]
FIG. 3.1A programme of 26 s: 8 s of the podcast, the band, 8 s of the blackbird, the tone, the noise. Over the waveform, what each part is; under it, the first listener's segments, the reading above. It moves to music 0.1 s late and leaves it 0.1 s early, and hears the blackbird, the tone and the noise as one stretch of noise.

The playground gives it a sound in parts of 10 s at most and adds up how long each kind holds over them. Where speech and music each hold a quarter or more, it says speech and music. Otherwise it says speech where speech holds at least as much as music and as much as noise, and music where music holds at least as much as noise. Noise is never said: to this network, noise is whatever is neither, a blackbird and a door alike. The programme holds speech 31%, music 19%, noise 50%, and gets no word from it.

On the package's labelled test sets it names speech as speech and songs as music almost without fail. A voice singing alone falls between the two. Noise alone it takes for speech or music about one frame in five, which is why its word for noise is not used.

Test set: the share of its active 10 ms frames named each kind7SpeechMusicNoise
VoiceBank+DEMAND speech, clean / noisy, 824 files each99.9 / 99.8%0.0 / 0.0%0.1 / 0.2%
The same speech over a music bed 10 dB down, 27598.6%1.4%0.0%
MUSDB18 test previews, songs, 500.0%100%0.0%
VocalSet sung phrases, 2026.8%66.4%6.8%
MUSDB18 vocal stems alone, 5038.1%57.5%4.4%
DEMAND noise alone, 82413.6%7.8%78.6%

Before networks this was done with rules. Scheirer and Slaney6 tried 13 features on FM radio, among them energy modulated at 4 Hz (the rate of syllables), the share of quiet frames, the spectrum's centroid, rolloff and flux, and zero crossings. Their best classifier got 5.8% of frames wrong, and 1.4% of 2.4 s segments. Split three ways, speech, music, or both at once, it was about 65% right, and they doubted the features could tell one genre from another. Rules need no download. They cannot name a blackbird.

04Everything else

Where the first listener has no word, the second is asked: YAMNet, by Manoj Plakal and Dan Ellis at Google,2 a MobileNet v14 trained on AudioSet,1 2,084,320 ten-second clips from YouTube labelled by people. Of AudioSet's classes it predicts 521.

It hears 0.96 s at a time, a patch every 0.48 s, as 64 mel bands from 125 to 7,500 Hz, and scores every class on each patch independently, so a patch can be Speech and Music at once. It has 3.7 million weights and makes 69.2 million multiplications a patch. @audio/neural-tag computes its input in JavaScript as Google's features.py does and runs the network through ONNX Runtime.8 Its file, 7,495,175 bytes, keeps the larger weights in float16. On 49 patches its scores differ from Google's Keras model by 3.6 × 10−3 at most, and the best class is the same in all 49. tag() ranks the classes by their mean over the patches.

FIG. 4.1The blackbird in 39 patches: the eight classes with the highest mean, each cell as bright as its score. The bird classes hold through the song; the row in colour gave the word. Point at a patch to read it.

Google gives its accuracy over the 521 classes on AudioSet's evaluation set: a balanced mean average precision of 0.306.2 Its model card warns that "YAMNet's classifier outputs have not been calibrated across classes, so you cannot directly treat the outputs as probabilities."3 A Clarinet of 0.6 and a Bird of 0.6 need not be equally sure.

05A word from the scores

The rule, called(), knows 132 of the 521 classes and gives them 127 words. 123 classes are particular, their words such as birdsong, clarinet, rain, typing; nine are general: speech, music, animal, birds, insects, water, vehicle, engine, noise. It says the best particular class whose mean score is 0.5 or more, else the best general one, else nothing.

The bar is high because the scores are not calibrated. It was set by reading about thirty files, the EBU's instrument excerpts and this site's blackbird among them. It is not fitted to a labelled set, and how often it is right on other sounds is not measured.

No family of instruments is said, though YAMNet has classes for them (brass, woodwind, bowed, plucked, mallet). It has no class for a bassoon, and scores one Brass instrument 0.58; none for a celesta, and scores one Vibraphone 0.36.

FIG. 5.1The 29 sounds read for this article, each with the tagger's twelve best classes on a scale from 0 to 1: filled where the class has a word here, hollow where it has none, in colour where the word came from. The dashed line is the bar. As the playground, the level and the first listener speak first and the tagger only where they have no word; the tagger alone, what it would say of each. Drag the bar.

Lower the bar to 0.35 and the glockenspiel is named, rightly; for the tagger alone, the bassoon becomes a french horn and the celesta a vibraphone. Raise it to 0.6 and the white noise loses its waterfall, and the trumpet its name. The first listener also hides some of the tagger's best answers: it calls the violin and the harp music, so the tagger, which would name them (0.68 and 0.61), is never asked.

06The whole of it, in code

import { segments } from '@audio/neural-denoise'  // 0.7: the first listener, its weights inside
import { tag } from '@audio/neural-tag'            // 0.1: YAMNet, its model fetched on first use
import { kindOf } from './kind.js'                 // the rule, as the playground has it
import { heard } from './listen.js'                // the stretches the playground listens to

const stretches = heard(channels, 44100).map(s => s.x)
const { kind, shares, tags } = await kindOf(stretches, 44100, {
  segments,
  tag: (x, rate) => tag(x, rate, { top: Infinity })
})
// kind: 'silence', 'speech', 'music', 'speech and music', a word from the list, or ''

heard gives what the playground listens to: the whole sound up to a minute, in equal parts of 10 s at most, so that its worker, which also plays, is never held longer than one part takes; else six stretches of 10 s spread from its start to its end; each the mean of its channels (listen.js). Inside, kindOf returns silence if no sample of any stretch reaches −70 dBFS; otherwise asks segments of each stretch and adds up the time each kind holds; returns that word if there is one; otherwise asks tag once, of the stretches end to end, and returns what called() makes of its scores. A tagger that fails says nothing and throws nothing. kind.js beside this article is the playground's own, repl/kind.js in audiojs/audio, copied; a test holds the two the same.

07Name your own

Drop a sound on the panel, choose a file, or pick one of this page's. Nothing is fetched until you do. Then the first listener loads from jsDelivr with its weights, and, if it has no word, the tagger with ONNX Runtime and the model from Hugging Face. Both run in this page; the sound goes nowhere.

FIG. 7.1Your sound, named as the playground names it: the word and who said it; its waveform, what was heard of it in full ink; the first listener's segments and the share each kind holds; where the tagger was asked, its five best, each meter marked at 0.5. A listener that cannot be loaded is named in a red line, and the other still speaks.

08What it costs

Bytes, fetched once and then kept by the browser, as measured in Chromium:

WhatBytesFromWhen
The first listener: its module, the resampler's and the runtime adapter'sabout 48,000*jsDelivrthe first sound
Its weights, guard.bin1,564,806jsDelivrthe first sound
The tagger's module and its FFTabout 29,000*jsDelivrthe first sound the first listener has no word for
ONNX Runtime Web 1.30, script and WebAssembly14,359,684, compressed 3,115,576jsDelivr
YAMNet, yamnet.fp16.onnx7,495,175Hugging Face

* The two packages' own modules as built here from their 0.7.0 and 0.1.0 source, the way jsDelivr builds a package; jsDelivr's builds may differ by a few kilobytes.

Time, on an Apple M4 Max (14 cores) under macOS 26.5, running other jobs at a load average of 4 to 11. In Node 25.9 with onnxruntime-node 1.30, nothing loaded, the blackbird's 18.8 s got its word in 358 ms: 265 ms for the first listener, its weights unpacked first, and 93 ms for the tagger, its session made first. A 2 s tone after that took 28 ms.

In headless Chromium, the two packages and the model served from this machine and ONNX Runtime fetched from jsDelivr, the blackbird's first word took 2.5 s, 2.1 s of it the tagger loading and running for the first time; the second time, 0.44 s. WebKit took as long, 2.5 s and then 0.40 s. In Firefox, as Playwright runs it, the first listener was 16 times slower than in Chromium, 2.0 s for 10 s of sound against 0.12 s, resampled or not, and the blackbird's first word took 9.1 s. Why is not traced.

Per minute of audio, by their own measurements: the first listener 1.1 s of CPU per channel,7 the tagger 0.49 to 0.54 s on one thread.8 In the playground both run in its worker, off the page's thread. In this article they run on the page's own thread, so a long file holds the page still for as long as they take.

09Where it is wrong

Wrong names, said. A 440 Hz sine is a telephone (Telephone 0.99, Dial tone 0.97), and so is the playground's own test sound, the same tone (0.98). Telephone lines do play such tones: the North American dial tone is 350 and 440 Hz together.10 But the file is a test tone. White noise is a waterfall (0.58; White noise 0.26).

Right names, not said. The violin (0.68) and the harp (0.61) would be named by the tagger, and the first listener says music before it is asked. The guitar (0.23) and the piano (0.42) score under the bar either way.

No word for some. The glockenspiel scores 0.36 and gets none. Quiet places get none. A mix such as the programme gets none: the tagger hears it whole, and nothing in it reaches 0.5.

Speech that is not speech. The synthetic voice, a sawtooth through three formants singing three vowels, is speech to the first listener throughout. A voice singing alone is either: MUSDB18's vocal stems are 57.5% music and 38.1% speech to it.

Whose words. What counts as speech or music is what the first listener's training examples were labelled; its README does not say what they were. The tagger's classes are AudioSet's, labelled on YouTube clips.

The bar. 0.5, set by reading these sounds, over scores their makers say are not calibrated.

Nothing here understands a sound. One network splits time into three kinds, the other gives 521 numbers for every 0.96 s, and a rule picks a word. Read the word as a label to check.

10Other listeners

Each project's own figures, not measured alike:

ModelSizeOn AudioSetLicence
YAMNet, here23.7M weights, 7.5 MBbalanced mAP 0.306Apache-2.0
CED-tiny115.5M parameters, ONNX 6.7 MBmAP 48.1weights Apache-2.0, code GPL-3.0
PANNs, the best of them12mAP 0.439
AST1386.6M parametersmAP 0.4593BSD-3-Clause
CLAP, any words as labels14quantized ONNX: audio 34.3 MB, text 127 MBApache-2.0

CED-tiny reports a higher score at a size close to YAMNet's; its weights and its code carry different licences, which would need settling with its authors before it is bundled. MediaPipe's Audio Classifier runs YAMNet in a browser too, as @mediapipe/tasks-audio.15

  1. J. F. Gemmeke, D. P. W. Ellis, D. Freedman, A. Jansen, W. Lawrence, R. C. Moore, M. Plakal, M. Ritter, “Audio Set: An ontology and human-labeled dataset for audio events,” ICASSP 2017. Counts as its page gives them.
  2. YAMNet, M. Plakal and D. Ellis: tensorflow/models research/audioset/yamnet at c14bf9a, its README: classes, weights, multiplications, patches, accuracy.
  3. YAMNet's model card, TF Hub google/yamnet/1, Limitations.
  4. A. G. Howard et al., “MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications,” 2017.
  5. D. Doukhan, J. Carrive, F. Vallet, A. Larcher, S. Meignier, “An Open-Source Speaker Gender Detection Framework for Monitoring Gender Equality,” ICASSP 2018; D. Doukhan, E. Lechapt, M. Evrard, J. Carrive, “INA's MIREX 2018 Music and Speech Detection System,” MIREX 2018, on its speech detection; ina-foss/inaSpeechSegmenter, its smn engine, the more recent of its two: by its README, the one the papers used had no noise class.
  6. E. Scheirer and M. Slaney, “Construction and evaluation of a robust multifeature speech/music discriminator,” ICASSP 1997: features, Tables 1 to 3, the conclusion.
  7. @audio/neural-denoise 0.7.0, its README: the music guard, segments(), the kinds test (scripts/accuracy.mjs kinds test), speed.
  8. @audio/neural-tag 0.1.0, packages/neural-tag, its README: features, verification against Keras, the model file, speed.
  9. The sounds read here and not played: EBU SQAM (Tech 3253) excerpts as the declipping survey of Záviška, Rajmic, Ozerov and Rencker uses them (rajmic/declipping2020_codes); J. Thiemann, N. Ito, E. Vincent, DEMAND, channel 1 of NRIVER, NPARK, NFIELD, DWASHING, OHALLWAY; Mihai Sorohan, solo trumpet 06, CC BY 3.0; US Army Strings, Brahms, Hungarian Dance no. 5, Musopen, public domain; Kevin MacLeod, Dance of the Sugar Plum Fairy and Vibe Ace, CC BY 3.0; audiojs/audio's test/fixture.wav. Played: the blackbird, Diana Tudor, xeno-canto XC1059970, CC BY 4.0, an excerpt; NASA, Houston We Have a Podcast 434, public domain. The rest are made in sounds.js.
  10. Precise Tone Plan: dial tone, 350 and 440 Hz.
  11. RicherMans/CED; mispeech/ced-tiny, mAP on AudioSet's full training set.
  12. Q. Kong et al., “PANNs: Large-Scale Pretrained Audio Neural Networks for Audio Pattern Recognition,” 2019, the abstract.
  13. Y. Gong, Y.-A. Chung, J. Glass, “AST: Audio Spectrogram Transformer,” 2021; MIT/ast-finetuned-audioset-10-10-0.4593, named for its mAP.
  14. laion/clap-htsat-unfused; its ONNX files, Xenova/clap-htsat-unfused.
  15. MediaPipe Audio Classifier.