Skip to content
Discussion options

You must be logged in to vote

it's a bug in your script, unrelated to stats.lua
this won't avoid duplicates as you expected

Ok thanks,

-- SoX_resample_auto.lua
local mp = require "mp"
local msg = require "mp.msg"

local function try_insert_up4x(attempt)
    local sr = mp.get_property_number("audio-params/samplerate")
    if not sr then
        if attempt < 10 then
            mp.add_timeout(0.5, function() try_insert_up4x(attempt + 1) end) -- delay 0.5 sec
        end
        return
    end

    local target_sr
    if sr == 48000 then
        target_sr = 192000
    elseif sr == 44100 then
        target_sr = 176400
    else
        return
    end

    local chain = (
        "aresample=resampler=soxr:cheby=0:cutoff=…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@YukiNeeSan
Comment options

Answer selected by YukiNeeSan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants