Latency Test

While setting up latency compensation is clearly described in the Audacity manual, it can be quite tricky to know which way to adjust the setting, and is particularly difficult for blind Audacity users.

To try and address these issues, I have written a macro which automates most of the process.

  1. First the macro must be imported into “Manage Macros”.
  2. Then check that Audacity is set up to record it’s own output, as described in “latency test”.
    (See: in the Audacity manual)
  3. Set the recording level quite high so that the maximum recording level will be close to full track height (0 dB)
  4. Then, in an empty project, run the macro.

While the macro runs, you should hear 5 loud clicks as it runs the test.

If all goes well, it should automatically set latency compensation correctly.
Note that with consumer grade audio hardware it is normal for latency to be a bit different on each run, but should be within about +/-1 millisecond. This macro takes the average of 5 runs and sets latency compensation accordingly.

I’ve only tested on my own (Linux) computer, and for me it works very reliably. If it works well for others I’ll suggest to the dev team that the add it to the next release. Please try it and post your results / reviews here.

(see next post for updated macro.)

Slightly tweaked version. This does not require such a high recording level, so hopefully less likely to throw an error.
latency-setup.txt (1.7 KB)

When I use this updated macro on an Intel Mac running Audacity 3.5.1, I get the following error:

Internal error at /Users/runner/work/audacity/audacity/libraries/lib-wave-track/WaveTrack.cpp line 1567

This path looks like it uses the home directory of the user who compiled audacity (the user “runner”) that path does not exist on my machine.

“timestamp”: 1714751465,
“event_id”: “ef6e42993bc14dbeb89bfbd38d985a24”,
“platform”: “native”,
“release”: “audacity@3.5.1”,
“contexts”: {
“os”: {
“type”: “os”,
“name”: “Macintosh”,
“version”: “10.16.0”
“exception”: {
“values”: [
“type”: “Internal_Error”,
“value”: “Internal error at / line 1567.\nPlease inform the Audacity team at https://.”,
“mechanism”: {
“type”: “runtime_error”,
“handled”: false

It’s a bug in Audacity. I’ll log it.

Bug logged here: Internal error in WaveTrack.cpp · Issue #6388 · audacity/audacity · GitHub