Flan
|
The "r8bsrc.dll" source file. More...
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... | |
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.
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.
rs | Resampler object to clear. |
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.
SrcSampleRate | Source signal sample rate. Both sample rates can be specified as a ratio, e.g. SrcSampleRate = 1.0, DstSampleRate = 2.0. |
DstSampleRate | Destination signal sample rate. |
MaxInLen | The 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. |
Res | Resampler's required resolution. |
void _cdecl r8b_delete | ( | CR8BResampler const | rs | ) |
Function deletes a resampler previously created via the r8b_create() function.
rs | Resampler object to delete. |
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.
rs | Resampler object that performs processing. | |
ip0 | Input buffer. This buffer may be used as output buffer by this function. | |
l | The number of samples available in the input buffer. | |
[out] | op0 | This 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. |