Strip Silence... BUT as a Lua script

Does anyone have access to such a script? I know it’s a built in feature. But I think that examining such a script would help me understand more how to make lua scripts in general, and would be an excellent place to start for a custom script I want to make.

I’ve searched GitHub, and there are some fantastic Ardour Lua repositories, and some scripts come close to this, such as “Delete by Threshold” in David Healey’s ardour-scripts repository.

Ultimately what I want to do is make:

  1. a strip-silence plugin, that ignores n seconds of level above the strip-silence dB threshold.
  2. rename all the newly created regions by speech recognition. I don’t even know if it’s possible to run a shell script from a lua script in Ardour, and capture the result, in order to do this. This would hopefully help when editing long multi-track podcasts.

I’ve tweaked some basic things in a custom lua script before, but on the whole, I’m totally mystified by the API exposed to Lua.

Someone made this ardour-lua-api intellisense extension for vscode BUT what I really need is an EXTREMELY DETAILED explanation of what each class/hook/function/method or whatever they’re called in Lua does. Otherwise I’m bumbling around in the dark.

A start might be ardour/_find_nonzero_sample.lua at master · Ardour/ardour · GitHub - and the “Set Region Gain” snippet

Those show how to get raw audio data, which you will need to determine silence levels.

While you can run external commands via os.execute and os.forkexec. It is currently not possible to capture the result. The former command is just system(3) and blocks ardour while it’s running. Since I expect speech recognition to take some time, one solution would be to start it in the background, write the results to a file and later read the results.

1 Like

This is just the sort of thing I was looking for, thank you! And thanks for the work around idea for accessing the speech recognition results!

Ahhh, I just jumped back to the enclosing folder on GitHub, and it explains why I would not have seen this in Ardour’s “scripts” folder on my machine. There’s a whole bunch of examples, and snippets that likely don’t get packaged!

Yes, all those with a leading underscore are example scripts. They are not useful as-is for users, so they are excluded from optimized release builds.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.