Listening Tests: MUSHRA, ACR, P.808-Style Studies and ABX
Run MUSHRA, BS.1116, ACR, DCR, CCR, P.835 and ABX listening tests in Potato with blinded stimuli, hidden references, anchors and post-screening in the export.
New in v2.12.0
A listening_test scheme runs a standard audio quality or discrimination test on each item. It covers subjective evaluation of codecs, speech enhancement, text-to-speech and music processing:
method | Standard | What the listener does |
|---|---|---|
mushra | ITU-R BS.1534-3 | Rates every sample from 0 to 100 against an open reference. The samples include a hidden reference and optional low-pass anchors |
bs1116 | ITU-R BS.1116 | Hears the reference, then A and B (one is the hidden reference), and rates each from 1.0 to 5.0 for impairment |
acr | ITU-T P.800, P.808, P.910 | Rates one sample: Excellent, Good, Fair, Poor or Bad |
dcr | ITU-T P.800 | Hears the reference, then the sample, and rates the degradation in five steps |
ccr | ITU-T P.800 | Compares two samples, from Much better to Much worse (+3 to -3) |
p835 | ITU-T P.835 | Rates one sample three times: speech signal, background and overall |
abx | Hears A, B and X, and says whether X is A or B |
All samples of a trial are decoded into one Web Audio context, so switching from one sample to another continues from the same position, and a loop region lets the listener compare a short passage. The page keeps track of what has been played, and the answer can be given only once the playback rule is met.
Potato bundles no test material. It ships no P.808 clips, no ITU texts and no reference recordings, so supply your own stimuli and get the standards from the ITU.
The hidden reference and two anchors are among the five samples
MUSHRA
annotation_schemes:
- annotation_type: listening_test
name: quality
method: mushra
description: Rate the audio quality of each sample against the reference
reference_field: reference
stimuli_field: stimuli
anchors: [3500, 7000]
label_requirement:
required: true{"id": "excerpt_1",
"reference": "/media/chord_ref.wav",
"stimuli": {"lowrate": "/media/chord_lowrate.wav", "coarse": "/media/chord_coarse.wav"}}stimuli maps condition names to files, and a list of {"id", "url"} objects also works. The page shows the reference, then one slider per sample: the conditions, the hidden reference (hidden_reference: true, the default) and one anchor per cut-off in anchors. Anchors are made from the reference by low-pass filtering at that frequency. BS.1534-3 asks for 3.5 kHz and recommends 7 kHz. This works for a PCM WAV reference, and for any other format you put the anchor files in stimuli yourself. Since 2.12.1 the server refuses to start when a mushra scheme sets anchors and an item's reference is not a .wav file, and the message names the item. potato validate does not load items, so it does not catch this.
A trial is complete when every sample has been listened to (for two seconds, or half the sample if it is shorter), every sample is rated, and at least one is rated 100 (require_one_at_100). Sliders start in the middle with a hollow thumb and count as rated only once moved.
ACR, DCR and P.835
These methods play one clip per item:
annotation_schemes:
- annotation_type: listening_test
name: quality
method: acr
description: How would you rate the quality of this speech sample?
stimuli_field: audio
condition_field: condition{"id": "clip_1", "audio": "/media/clip_1.wav", "condition": "noise_10db"}condition_field names the item field holding the clip's condition, so the export can report a mean opinion score per codec, system or noise level. The rating buttons stay disabled until the clip has played to the end (require_full_playback, the default for these methods). DCR also needs reference_field. scale_labels replaces the five category labels for acr and dcr, or the seven for ccr, best first.
CCR and ABX
ccr and abx read two conditions from stimuli. CCR presents them in a seeded order and stores the rating of the second against the first, and the export turns it into a score for each condition against the other. ABX plays A, B and an X that is one of them, chosen per listener and item.
Options
| Key | Default | Meaning |
|---|---|---|
method | mushra | One of the seven methods above |
stimuli_field | stimuli | Item field with the samples: a map, a list, or one file |
reference_field | reference | Item field with the open reference (mushra, bs1116, dcr) |
condition_field | condition | Item field naming a single clip's condition |
hidden_reference | true | Adds the reference among the MUSHRA samples |
anchors | none | Low-pass anchor cut-offs in Hz, made from a WAV reference (mushra only) |
loop | true for mushra and bs1116 | Shows the loop controls |
require_full_playback | true for single-clip methods and ABX | Allows an answer only after every sample has played to the end |
require_all_played | true | Allows an answer only after the listener has played every sample |
require_one_at_100 | true for mushra | One sample must be rated 100 |
scale_labels | the standard's | Five (acr, dcr) or seven (ccr) labels, best first |
instructions | none | Text shown under the question |
label_requirement | required: true makes the trial required, as for any scheme |
Keys 1 to 9 play a sample, R plays the reference and Space pauses. They work while focus is on one of the test's buttons and do not trigger Potato's label shortcuts. While a slider, the position bar or a loop control has focus, keys go to that control instead.
Blinding the stimuli
The page is never told which sample is which. It gets slot names (Sample 1, A, X) and audio URLs of the form /api/listening/audio/<scheme>/<item>/<slot>, and the order is shuffled per listener and per item. The shuffle is seeded, so it is the same on every visit and can be recomputed for the export without being stored.
- The stimulus, reference and condition fields are left out of the item data sent to the page.
- Files named by a listening item are not served at
/media/, so they cannot be downloaded and compared with the slots. A file used by a listening item cannot also be shown by another scheme through/media/, so give that scheme its own copy. - Each slot response carries no ETag, Last-Modified header or file name. WAV, FLAC and MP3 files get a padding block of random length inside the container, so two slots holding the same file (the hidden reference, or ABX's X) have different bytes while the audio is unchanged.
Blinding stops casual and scripted lookups of files, headers and hashes. A participant who opens the browser's developer tools can still compare the decoded audio. Other audio formats are sent unchanged with a warning in the server log, so use WAV, FLAC or MP3 for ABX and the hidden reference. A sample given as an http(s) URL is fetched through a redirect and shows in the browser's network log, so serve the files of a blind test from the project's media/ directory.
Export
python -m potato.export --config config.yaml --format listening_test --output ./export/The export maps every slot back to its condition and writes:
| File | Contents |
|---|---|
listening_ratings.csv | One row per rating: participant, item, scheme, method, slot, condition, scale and score |
listening_summary.csv | Per scheme, condition and scale: n, mean, SD and 95% confidence interval |
listening_abx.csv | Per participant and ABX scheme: trials, correct, proportion and one-sided binomial p |
listening_screening.csv | Per participant and MUSHRA scheme: the BS.1534-3 post-screening counts and whether the rule excludes them |
ACR, DCR and the P.835 scales run from 5 (best) to 1, MUSHRA from 0 to 100, BS.1116 from 1.0 to 5.0, and CCR from +3 to -3.
The post-screening rule, as implemented, excludes a listener who rates the hidden reference below 90 on more than 15% of items, or the mid anchor (the highest anchor cut-off) above 90 on more than 15% of items. An item on which more than 25% of listeners rate the mid anchor above 90 is left out of the anchor test for everyone. Excluded listeners are flagged in the file, not removed.
Running a P.808-style study
ITU-T P.808 also asks for a qualification step, training with gold clips, and trapping clips inside the rating session. In Potato:
- Qualification: a headphone check page, scored on the server, plus a prestudy survey about the listening environment.
- Training: a training phase with gold answers.
- Trapping clips: attention checks whose expected answer is the category the clip announces.
Microsoft's P.808 toolkit ships its clips under several licenses, and Potato bundles none of them.
Playback goes through the browser's audio output. Potato cannot calibrate level or check the playback chain beyond the headphone check.
Examples
python potato/flask_server.py start examples/audio/listening-test-mushra/config.yaml -p 8000
python potato/flask_server.py start examples/audio/listening-test-p808/config.yaml -p 8000The second runs a headphone check, then speech clips rated on the ACR scale.
Further Reading
- Runtime Phases - The headphone check and its scoring
- Audio Annotation - Segmenting and labeling audio
- Training Phase - Practice items with gold answers and feedback
- Quality Control - Attention checks and gold items
For implementation details, see the source documentation.