Git Product home page Git Product logo

Comments (2)

unevens avatar unevens commented on June 16, 2024

hi. no, there are overloads that take the number of input samples aka the block size

for example the iir upsampler has

      /**
       * Up-samples the input.
       * @param input a pointer to the memory holding the input samples
       * @param numInputSamples the number of samples in each channel of the input
       * buffer
       * @param output an InterleavedBuffer to hold the up-sampled samples
       * @param numChannelsToProcess the number of channels to process. If negative,
       * all channels will be processed.
       */
      void processBlock(Scalar* const* inputs,
                        uint32_t numInputSamples,
                        InterleavedBuffer<Scalar>& output,
                        int numChannelsToProcess)

dor the iir downsampler

      /**
       * Down-samples the input.
       * @param input an InterleavedBuffer holding the input
       * @param numSamples the number of samples in each channel of the input
       * buffer
       * @param numChannelsToProcess the number of channels to process. If negative,
       * all channels will be processed.
       */
      void processBlock(InterleavedBuffer<Scalar> const& input, uint32_t numSamples, int numChannelsToProcess)

the fir upsampler

      /**
       * Up-samples a multi channel input buffer.
       * @param input pointer to the input buffer.
       * @param numChannels number of channels of the input buffer
       * @param numSamples the number of samples of each channel of the input
       * buffer.
       * @return number of upsampled samples
       */
      uint32_t processBlock(double* const* input, uint32_t numChannels, uint32_t numSamples);

the fir downsampler

      /**
       * Down-samples a multi channel input buffer.
       * @param input pointer to the input buffers.
       * @param output pointer to the memory in which to store the downsampled data.
       * @param numOutputChannels number of channels of the output buffer
       * @param requiredSamples the number of samples needed as output
       */
      void processBlock(double* const* input,
                        uint32_t numSamples,
                        double** output,
                        uint32_t numOutputChannels,
                        uint32_t requiredSamples);

from oversimple.

unevens avatar unevens commented on June 16, 2024

also, the methods that don't take the number of samples as an argument, retrieve it from the buffer object, as in

      /**
       * Up-samples a multi channel input buffer.
       * @param input ScalarBuffer that holds the input buffer.
       * @return number of upsampled samples
       */
      uint32_t processBlock(ScalarBuffer<float> const& input)
      {
        return processBlock(input.get(), input.getNumChannels(), input.getNumSamples());
      }

the maximum size of the block must be set by calling the prepareBuffers method, which will allocate the necessary resources. in the context of an audio plugin you can do that in the methods like vst3's setupProcessing or setActive.

from oversimple.

Related Issues (2)

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.