Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to evaluate windowed loudness #30

Open
thesby opened this issue Jun 17, 2020 · 1 comment
Open

how to evaluate windowed loudness #30

thesby opened this issue Jun 17, 2020 · 1 comment

Comments

@thesby
Copy link

thesby commented Jun 17, 2020

I have a 60 seconds music, and I need to calculate every 0.5 second window loudness. How to implement it ? Should I just split the music into pieces and calculate each piece loudness?

@FlRE-DEATH
Copy link

data, rate = sf.read(path) # load audio (with shape (samples, channels))
meter = pyln.Meter(rate=rate,block_size=0.3) # create BS.1770 meter
loudnesses = []
for w in range(data.shape[0]//100):
loudnesses.append(meter.integrated_loudness(data[w:w+int(0.3*rate),0:2]))
print(loudnesses[0:10])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants