Update Lua VAMP scripts, follow readable API change since 7.0

This commit is contained in:
Robin Gareus 2022-11-26 16:30:53 +01:00
parent bc6a9609ff
commit 84b11298c9
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 12 additions and 2 deletions

View file

@ -19,10 +19,14 @@ function factory () return function ()
-- for each selected region
for r in sel.regions:regionlist ():iter () do
local ar = r:to_audioregion ()
if ar:isnil () then
goto next
end
print ("Region:", r:name ())
-- run the plugin, analyze the first channel of the audio-region
vamp:analyze (r:to_readable (), 0, nil)
vamp:analyze (ar:to_readable (), 0, nil)
-- get analysis results
local f = vamp:plugin ():getRemainingFeatures ()
@ -59,5 +63,6 @@ function factory () return function ()
-- reset the plugin for the next iteration
vamp:reset ()
::next::
end
end end