Flan
Functions | Variables
r8bfreesrc.cpp File Reference

$ bin "Win64/r8bfreesrc" More...

#include "/libvox/Sources/Core/AppMain.h"
#include "/libvox/Sources/Other/CWaveFile.h"
#include "../CDSPResampler.h"
Include dependency graph for r8bfreesrc.cpp:

Functions

Args addReqArg (argtFileName, "in-file", "The input WAV/Wave64/AIF filename.")
 
Args addReqArg (argtFileName, "out-file", "The output WAV filename.")
 
Args addReqArg (argtDouble, "out-sample-rate", "The output sample rate " "(e.g. 96000).")
 
Args addOptArg (argtDouble, "trans-band", "t", "2.0", "Transition band in percent.")
 
 VOXCHECK (Args.checkArgs())
 
 VOXCHECK (inf.loadFile(*Args.getArgValue("in-file").ValueStr))
 
 if (OutSampleRate<=0.0)
 
 if (d >=(1<< 29))
 
outf inheritFormat (inf)
 
outf inheritCuePoints (inf)
 
outf inheritInfo (inf)
 
 VOXCHECK (outf.saveFile(*Args.getArgValue("out-file").ValueStr))
 
CInitArray< CFixedBuffer< double > > InBufs (inf.ChannelCount)
 
CInitArray< CPtrKeeper< r8b ::CDSPResampler24 *> > Resamps (inf.ChannelCount)
 
 if (tb< r8b ::CDSPFIRFilter ::getLPMinTransBand()||tb > r8b ::CDSPFIRFilter ::getLPMaxTransBand())
 
 for (i=0;i< inf.ChannelCount;i++)
 
CArray< double *> opp (inf.ChannelCount)
 
 while (ol > 0)
 
 VOXCHECK (outf.finalize())
 
 printf ("Resampled in %.4f s, %.3f Mflops (excluding IO operations)\, srct, 1e-6 *ool/srct)
 

Variables

 VOXMAIN
 
CWaveFile inf
 
double OutSampleRate = Args.getArgValue( "out-sample-rate" ).Value.Double
 
const double InSampleRate = inf.SampleRate
 
const double d
 
CWaveFile outf
 
outf SampleRate = OutSampleRate
 
const int InBufCapacity = 2048
 
const double tb = Args.getArgValue( "trans-band" ).Value.Double
 
int i
 
int64_t ol
 
int64_t ool = 0
 
double srct = 0.0
 
 VOXRET
 

Detailed Description

$ bin "Win64/r8bfreesrc"

Test/benchmarking utility.

This is an example file which you won't be able to compile as it includes some undisclosed program code. Please consider this example as a pseudo-code demonstrating the use of the library. Here you can find an example implementation of the simplest sample rate converter utility.

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

Variable Documentation

◆ d

const double d
Initial value:
= ( OutSampleRate > InSampleRate ?
OutSampleRate / InSampleRate : InSampleRate / OutSampleRate )

◆ ol

int64_t ol
Initial value:
= (int64_t) ( inf.SampleCount * OutSampleRate /
InSampleRate )

◆ VOXMAIN

VOXMAIN
Initial value:
{
Args.setProgramDescription( "This utility program perform sample rate "
"conversion of the source WAV/Wave64/AIF sound file." )