Coder Social home page Coder Social logo

Comments (4)

l0calh05t avatar l0calh05t commented on July 3, 2024

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 8s in the second test have to be replaced by 80s obviously).

from ebur128.

l0calh05t avatar l0calh05t commented on July 3, 2024

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.

sdroege avatar sdroege commented on July 3, 2024

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.

l0calh05t avatar l0calh05t commented on July 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.