Giter VIP home page Giter VIP logo

Comments (4)

InterLinked1 avatar InterLinked1 commented on June 7, 2024

The line numbers you provided don't seem to quite line up, but are you referring to this one? https://github.com/asterisk/asterisk/blob/master/apps/app_amd.c#L372

The DSP itself is responsible for accumulation so we shouldn't be incrementing in the application, the value is set by the core DSP function. Is there another issue you're seeing here?

from asterisk.

moha-abdi avatar moha-abdi commented on June 7, 2024

Yes that is the one I was reffetring.
We pass the DSP a pointer to dspsilence here. Since dspsilence is set to zero each time, this means the DSP will only accumulate the current frame's calculated silence duration to dspsilence (which is 0), as shown here. Consequently, in each iteration, dspsilence is actually reset to zero, except if the type is not AST_FRAME_VOICE, which is not the case for this issue.

The main question is how will this line ever be true, if the default value for initialSilence was 2.5 seconds and the the silence duration variable only contains the length for the current frame, as in here

from asterisk.

InterLinked1 avatar InterLinked1 commented on June 7, 2024

Yes that is the one I was reffetring. We pass the DSP a pointer to dspsilence here. Since dspsilence is set to zero each time, this means the DSP will only accumulate the current frame's calculated silence duration to dspsilence (which is 0), as shown [here]

I'm not following... dsp->totalsilence does accumulate internally and this just sets it to whatever that currently is.

Technically the initialization is unnecessary, since that should always be assigned as it's non-NULL. But I don't think the initialization does any harm.

(https://github.com/asterisk/asterisk/blob/master/main/dsp.c#L1248). Consequently, in each iteration, dspsilence is actually reset to zero, except if the type is not AST_FRAME_VOICE, which is not the case for this issue.

The main question is how will this line ever be true, if the default value for initialSilence was 2.5 seconds and the the silence duration variable only contains the length for the current frame, as in here

I guess I disagree that it's for the current frame... I might have missed something but that's what a quick scan of the code in dsp.c suggests. The link you linked shows an increment, nore a replace. The dsp is stateful and keeps track of things between frames. Also, the logic does work for existing use cases.

from asterisk.

moha-abdi avatar moha-abdi commented on June 7, 2024

I guess I disagree that it's for the current frame... I might have missed something but that's what a quick scan of the code in dsp.c suggests. The link you linked shows an increment, nore a replace. The dsp is stateful and keeps track of things between frames. Also, the logic does work for existing use cases.

Thanks for the explanation this looks quite confincing to me, I oversaw this line which means its working normally, and I am sorry for the time that this cost you. Good luck.

from asterisk.

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.