Comments (4)
I had a quick look into this, and I have a question: Where does your chunk size of 100 ms come from? I ask, because if I go down to a chunk size of 10 ms (20 ms also seem to work, anything larger causes the tests to fail again) like so:
for chunk in samples.chunks(2 * 48_000 / 100) {
e.add_frames_i32(chunk).expect("Failed to analyze samples");
let loudness = e
.loudness_momentary()
.expect("Failed to get momentary loudness");
if loudness > max_loudness {
max_loudness = loudness;
}
}
The tests pass (the 8
s in the second test have to be replaced by 80
s obviously).
from ebur128.
Just for clarification, I looked at the chunk size because these tests ask for a maximum momentary loudness and while even momentary loudness has a 400ms window, it is still a sliding window and the maximum can occur at any point. loudness_momentary
returns the current loudness at the end of a chunk, but the maximum could have been at any point between.
(I didn't check the i%8
expressions in the second test in too much detail, it may no longer represent exactly what the spec mentions)
from ebur128.
Makes sense. I didn't put much thought into the chunk size :) can you update the PR to use 10ms? That seems like a nicer number to understand the calculations around it.
Thanks!
from ebur128.
Makes sense. I didn't put much thought into the chunk size :) can you update the PR to use 10ms? That seems like a nicer number to understand the calculations around it.
Thanks!
Done 🙂
from ebur128.
Related Issues (18)
- Port C code to Rust HOT 6
- Add libebur128 ABI-compatible C API
- Add test suite around EBU behind a separate cargo feature
- Fix travis CI failures HOT 3
- Try tinyvec instead of smallvec
- WIP: Add WASM/JS bindings via wasm-bindgen and example
- Consistently use Iterator::zip(a, b) instead of a.zip(b)
- Replace C tests with Rust tests for the individual components and get rid of all C dependencies
- Use cargo-c C testing feature for testing the exported C API
- Properly benchmark C/Rust version HOT 2
- Panic when calling loudness_range HOT 7
- Optimize Rust implementation HOT 2
- Potential performance regression HOT 8
- How to use for real time processing HOT 21
- Add `EbuR128::set_channels()` that sets all channel positions at once
- Add support for adding non-interleaved samples HOT 2
- Move C comparison tests behind a separate cargo feature
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ebur128.