import sys,struct,subprocess
for f in sys.argv[1:]:
    p=subprocess.run(["ffmpeg","-v","error","-i",f,"-f","s16le","-ac","1","-"],capture_output=True)
    o=p.stdout;n=len(o)//2;v=struct.unpack("<%dh"%n,o[:n*2])
    k=0
    while k<n and v[k]==0:k+=1
    print("  ->",f,"samples",n,"first",v[0] if n else None,"last",v[-1] if n else None,"leading zeros",k)
