Giter Club home page Giter Club logo

Comments (5)

Ashymad avatar Ashymad commented on September 27, 2024 1

@bjkwon I was having the same problem and it seems that you are supposed to call src_process one more time, after sending the last block of input data, with input_frames = 0. This returns the last few missing samples.

from libsamplerate.

erikd avatar erikd commented on September 27, 2024 1

Yes, as @Ashymad says, you are supposed to keep calling src_proccess with zero input samples and the end_of_input field set to 1 until you get not more output samples.

The examples do this, for example examples/timewarp-file.c.

from libsamplerate.

erikd avatar erikd commented on September 27, 2024

I assume this is the change you are talking about:

diff --git a/src/src_sinc.c b/src/src_sinc.c
index 6b465a7..6379ea0 100644
--- a/src/src_sinc.c
+++ b/src/src_sinc.c
@@ -372,7 +372,7 @@ sinc_mono_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data)
        terminate = 1.0 / src_ratio + 1e-20 ;
 
        /* Main processing loop. */
-       while (filter->out_gen < filter->out_count)
+       while (1)
        {
                /* Need to reload buffer? */
                samples_in_hand = (filter->b_end - filter->b_current + filter->b_len) % filter->b_len ;

With that change, the test suite fails with a segfault.

from libsamplerate.

bjkwon avatar bjkwon commented on September 27, 2024

Hmm... A quick fix is not a good fix, I guess.
Then, I would appreciate a proper way to address this issue.

Or, was there anything I missed? Perhaps was I calling src_process a wrong way? That is possible because I had to do a lot of guesswork while using it.

from libsamplerate.

erikd avatar erikd commented on September 27, 2024

I am still unconvinced that there even is an issue. This is a widely used library, that has changed little in a decade and it has a comprehensive test suite.

The tests and the example code in this repo show how to use src_process.

from libsamplerate.

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.