Giter Site home page Giter Site logo

Comments (4)

bartolsthoorn avatar bartolsthoorn commented on August 24, 2024

It has been a long time since I last touched that part of the code, but I think what you are looking for is this: NVDSP.mm#L75
So in fact, the buffer is copied starting from the 3rd index, just like your line does, using &(tInputBuffer[2]). The code in NVDSP is presented in a different way than the page you mentioned, but operates in a similar way. Each time, 2 samples are stored to ensure a smooth transition between buffers. An error in this process will immediately lead to noticeable distortion. The buffers are very short, and without handling trailing/leading samples correctly, a fast "clicking" distortion will be introduced at each new buffer that calls filterContiguousData.
I will close this for now, but please correct me if I am wrong and definitely let me know if you do hear any distortion caused by the problem you mentioned.

from nvdsp.

crontab avatar crontab commented on August 24, 2024

Strangely, there is no difference in audio either way, with or without +2! But I believe the way vDSP_deq22() works is, the output data start at +2. A lot of examples on the Internet confirm that.

from nvdsp.

bartolsthoorn avatar bartolsthoorn commented on August 24, 2024

Hmm, even the official API states "This function creates N new values in output vector C, beginning with its third element." - apple_ref/c/func/vDSP_deq22

I looked into it and I think the only difference is that NVDSP outputs the first two samples (in gInputKeepBuffer) the very first time, but after that it does not matter (in practice) whether you output +2, because the buffer start/end still connect perfectly. If this is true, NVDSP introduces a 2-sample delay though, which is what I will look for now. I will do some testing and let you know what I find. I will ask you to make a merge request if you want to - for the Github love.

from nvdsp.

bartolsthoorn avatar bartolsthoorn commented on August 24, 2024

@crontab Tested it, and you were right, using the +2 is slightly better, it prevents the 2 samples delay and leads to the same audio. Could you make a merge request with the new line?

memcpy(data, tOutputBuffer + 2, numFrames * sizeof(float));

from nvdsp.

Related Issues (20)

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.