Flan
Functions
r8bsrc.cpp File Reference

The "r8bsrc.dll" source file. More...

#include "r8bsrc.h"
#include "../CDSPResampler.h"
Include dependency graph for r8bsrc.cpp:

Functions

CR8BResampler _cdecl r8b_create (const double SrcSampleRate, const double DstSampleRate, const int MaxInLen, const double ReqTransBand, const ER8BResamplerRes Res)
 Function creates a new linear-phase resampler object. More...
 
void _cdecl r8b_delete (CR8BResampler const rs)
 Function deletes a resampler previously created via the r8b_create() function. More...
 
void _cdecl r8b_clear (CR8BResampler const rs)
 Function clears (resets) the state of the resampler object and returns it to the state after construction. More...
 
int _cdecl r8b_process (CR8BResampler const rs, double *const ip0, int l, double *&op0)
 Function performs sample rate conversion. More...
 

Detailed Description

The "r8bsrc.dll" source file.

This source file contains implementation of the DLL functions defined in the "r8bsrc.h" file. This source file was designed for a proprietary DLL compilation process (includes //$ definitions). The compiled DLL and LIB files of the latest version can be downloaded at project's home page: https://github.com/avaneev/r8brain-free-src

r8brain-free-src Copyright (c) 2013-2019 Aleksey Vaneev See the "License.txt" file for license.

Function Documentation

◆ r8b_clear()

void _cdecl r8b_clear ( CR8BResampler const  rs)

Function clears (resets) the state of the resampler object and returns it to the state after construction.

All input data accumulated in the internal buffer of this resampler object so far will be discarded.

Parameters
rsResampler object to clear.

◆ r8b_create()

CR8BResampler _cdecl r8b_create ( const double  SrcSampleRate,
const double  DstSampleRate,
const int  MaxInLen,
const double  ReqTransBand,
const ER8BResamplerRes  Res 
)

Function creates a new linear-phase resampler object.

Parameters
SrcSampleRateSource signal sample rate. Both sample rates can be specified as a ratio, e.g. SrcSampleRate = 1.0, DstSampleRate = 2.0.
DstSampleRateDestination signal sample rate.
MaxInLenThe maximal planned length of the input buffer (in samples) that will be passed to the resampler. The resampler relies on this value as it allocates intermediate buffers. Input buffers longer than this value should never be supplied to the resampler. Note that the resampler may use the input buffer itself for intermediate sample data storage.
ResResampler's required resolution.

◆ r8b_delete()

void _cdecl r8b_delete ( CR8BResampler const  rs)

Function deletes a resampler previously created via the r8b_create() function.

Parameters
rsResampler object to delete.

◆ r8b_process()

int _cdecl r8b_process ( CR8BResampler const  rs,
double *const  ip0,
int  l,
double *&  op0 
)

Function performs sample rate conversion.

If the source and destination sample rates are equal, the resampler will do nothing and will simply return the input buffer unchanged.

You do not need to allocate an intermediate output buffer for use with this function. If required, the resampler will allocate a suitable intermediate output buffer itself.

Parameters
rsResampler object that performs processing.
ip0Input buffer. This buffer may be used as output buffer by this function.
lThe number of samples available in the input buffer.
[out]op0This variable receives the pointer to the resampled data. This pointer may point to the address within the "ip0" input buffer, or to *this object's internal buffer. In real-time applications it is suggested to pass this pointer to the next output audio block and consume any data left from the previous output audio block first before calling the r8b_process() function again. The buffer pointed to by the "op0" on return may be owned by the resampler, so it should not be freed by the caller.
Returns
The number of samples available in the "op0" output buffer. If the data from the output buffer "op0" is going to be written to a bigger output buffer, it is suggested to check the returned number of samples so that no overflow of the bigger output buffer happens.