/********* WARNING: MENTAL SANITY ENDS HERE *************/
/* If the resampler is defined outside of Speex, we change the symbol names so that
there won't be any clash if linking with Speex later on. */
/* #define RANDOM_PREFIX your software name here */ #define RANDOM_PREFIX moz_speex #ifndef RANDOM_PREFIX #error"Please define RANDOM_PREFIX (above) to something specific to your project to prevent symbol name clashes" #endif
#define CAT_PREFIX2(a,b) a ## b #define CAT_PREFIX(a,b) CAT_PREFIX2(a, b)
/** Create a new resampler with integer input and output rates. *@paramnb_channelsNumberofchannelstobeprocessed *@paramin_rateInputsamplingrate(integernumberofHz). *@paramout_rateOutputsamplingrate(integernumberofHz). *@paramqualityResamplingqualitybetween0and10,where0haspoorquality *and10hasveryhighquality. *@returnNewlycreatedresamplerstate *@retvalNULLError:notenoughmemory
*/
SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
spx_uint32_t in_rate,
spx_uint32_t out_rate, int quality, int *err);
/** Create a new resampler with fractional input/output rates. The sampling *rateratioisanarbitraryrationalnumberwithboththenumeratorand *denominatorbeing32-bitintegers. *@paramnb_channelsNumberofchannelstobeprocessed *@paramratio_numNumeratorofthesamplingrateratio *@paramratio_denDenominatorofthesamplingrateratio *@paramin_rateInputsamplingrateroundedtothenearestinteger(inHz). *@paramout_rateOutputsamplingrateroundedtothenearestinteger(inHz). *@paramqualityResamplingqualitybetween0and10,where0haspoorquality *and10hasveryhighquality. *@returnNewlycreatedresamplerstate *@retvalNULLError:notenoughmemory
*/
SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
spx_uint32_t ratio_num,
spx_uint32_t ratio_den,
spx_uint32_t in_rate,
spx_uint32_t out_rate, int quality, int *err);
/** Destroy a resampler state. *@paramstResamplerstate
*/ void speex_resampler_destroy(SpeexResamplerState *st);
/** Resample a float array. The input and output buffers must *not* overlap. *@paramstResamplerstate *@paramchannel_indexIndexofthechanneltoprocessforthemulti-channel *base(0otherwise) *@paraminInputbuffer *@paramin_lenNumberofinputsamplesintheinputbuffer.Returnsthe *numberofsamplesprocessed *@paramoutOutputbuffer *@paramout_lenSizeoftheoutputbuffer.Returnsthenumberofsampleswritten
*/ int speex_resampler_process_float(SpeexResamplerState *st,
spx_uint32_t channel_index, constfloat *in,
spx_uint32_t *in_len, float *out,
spx_uint32_t *out_len);
/** Resample an int array. The input and output buffers must *not* overlap. *@paramstResamplerstate *@paramchannel_indexIndexofthechanneltoprocessforthemulti-channel *base(0otherwise) *@paraminInputbuffer *@paramin_lenNumberofinputsamplesintheinputbuffer.Returnsthenumber *ofsamplesprocessed *@paramoutOutputbuffer *@paramout_lenSizeoftheoutputbuffer.Returnsthenumberofsampleswritten
*/ int speex_resampler_process_int(SpeexResamplerState *st,
spx_uint32_t channel_index, const spx_int16_t *in,
spx_uint32_t *in_len,
spx_int16_t *out,
spx_uint32_t *out_len);
/** Resample an interleaved float array. The input and output buffers must *not* overlap. *@paramstResamplerstate *@paraminInputbuffer *@paramin_lenNumberofinputsamplesintheinputbuffer.Returnsthenumber *ofsamplesprocessed.Thisisallper-channel. *@paramoutOutputbuffer *@paramout_lenSizeoftheoutputbuffer.Returnsthenumberofsampleswritten. *Thisisallper-channel.
*/ int speex_resampler_process_interleaved_float(SpeexResamplerState *st, constfloat *in,
spx_uint32_t *in_len, float *out,
spx_uint32_t *out_len);
/** Resample an interleaved int array. The input and output buffers must *not* overlap. *@paramstResamplerstate *@paraminInputbuffer *@paramin_lenNumberofinputsamplesintheinputbuffer.Returnsthenumber *ofsamplesprocessed.Thisisallper-channel. *@paramoutOutputbuffer *@paramout_lenSizeoftheoutputbuffer.Returnsthenumberofsampleswritten. *Thisisallper-channel.
*/ int speex_resampler_process_interleaved_int(SpeexResamplerState *st, const spx_int16_t *in,
spx_uint32_t *in_len,
spx_int16_t *out,
spx_uint32_t *out_len);
/** Set (change) the input/output sampling rates (integer value). *@paramstResamplerstate *@paramin_rateInputsamplingrate(integernumberofHz). *@paramout_rateOutputsamplingrate(integernumberofHz).
*/ int speex_resampler_set_rate(SpeexResamplerState *st,
spx_uint32_t in_rate,
spx_uint32_t out_rate);
/** Get the current input/output sampling rates (integer value). *@paramstResamplerstate *@paramin_rateInputsamplingrate(integernumberofHz)copied. *@paramout_rateOutputsamplingrate(integernumberofHz)copied.
*/ void speex_resampler_get_rate(SpeexResamplerState *st,
spx_uint32_t *in_rate,
spx_uint32_t *out_rate);
/** Set (change) the input/output sampling rates and resampling ratio *(fractionalvaluesinHzsupported). *@paramstResamplerstate *@paramratio_numNumeratorofthesamplingrateratio *@paramratio_denDenominatorofthesamplingrateratio *@paramin_rateInputsamplingrateroundedtothenearestinteger(inHz). *@paramout_rateOutputsamplingrateroundedtothenearestinteger(inHz).
*/ int speex_resampler_set_rate_frac(SpeexResamplerState *st,
spx_uint32_t ratio_num,
spx_uint32_t ratio_den,
spx_uint32_t in_rate,
spx_uint32_t out_rate);
/** Get the current resampling ratio. This will be reduced to the least *commondenominator. *@paramstResamplerstate *@paramratio_numNumeratorofthesamplingrateratiocopied *@paramratio_denDenominatorofthesamplingrateratiocopied
*/ void speex_resampler_get_ratio(SpeexResamplerState *st,
spx_uint32_t *ratio_num,
spx_uint32_t *ratio_den);
/** Set (change) the conversion quality. *@paramstResamplerstate *@paramqualityResamplingqualitybetween0and10,where0haspoor *qualityand10hasveryhighquality.
*/ int speex_resampler_set_quality(SpeexResamplerState *st, int quality);
/** Get the conversion quality. *@paramstResamplerstate *@paramqualityResamplingqualitybetween0and10,where0haspoor *qualityand10hasveryhighquality.
*/ void speex_resampler_get_quality(SpeexResamplerState *st, int *quality);
/** Set (change) the input stride. *@paramstResamplerstate *@paramstrideInputstride
*/ void speex_resampler_set_input_stride(SpeexResamplerState *st,
spx_uint32_t stride);
/** Get the input stride. *@paramstResamplerstate *@paramstrideInputstridecopied
*/ void speex_resampler_get_input_stride(SpeexResamplerState *st,
spx_uint32_t *stride);
/** Set (change) the output stride. *@paramstResamplerstate *@paramstrideOutputstride
*/ void speex_resampler_set_output_stride(SpeexResamplerState *st,
spx_uint32_t stride);
/** Get the output stride. *@paramstResamplerstatecopied *@paramstrideOutputstride
*/ void speex_resampler_get_output_stride(SpeexResamplerState *st,
spx_uint32_t *stride);
/** Get the latency introduced by the resampler measured in input samples. *@paramstResamplerstate
*/ int speex_resampler_get_input_latency(SpeexResamplerState *st);
/** Get the latency introduced by the resampler measured in output samples. *@paramstResamplerstate
*/ int speex_resampler_get_output_latency(SpeexResamplerState *st);
/** Make sure that the first samples to go out of the resamplers don't have *leadingzeros.Thisisonlyusefulbeforestartingtouseanewlycreated *resampler.Itisrecommendedtousethatwhenresamplinganaudiofile,as *itwillgenerateafilewiththesamelength.Forreal-timeprocessing, *itisprobablyeasiernottousethiscall(sothattheoutputduration *isthesameforthefirstframe). *@paramstResamplerstate
*/ int speex_resampler_skip_zeros(SpeexResamplerState *st);
/** Set the numerator in a fraction determining the advance through input *samplesbeforewritinganyoutputsamples.Thedenominatorofthefraction *isthevaluereturnedfromspeex_resampler_get_ratio()inratio_den.This *isonlyusefulbeforestartingtouseanewlycreatedorresetresampler. *Ifthefirstinputsampleisinterpretedasthesignalattime *input_latency*in_rate,thenthefirstoutputsamplerepresentsthesignal *atthetimefrac_num/ratio_num*out_rate. *Thisisintendedforcarefulalignmentofoutputsamplepointswrtinput *samplepoints.Largevaluesarenotanefficientoffsetintotheinbuffer. *@paramstResamplerstate *@paramskip_frac_numNumeratoroftheoffsetfraction, *between0andratio_den-1.
*/ int speex_resampler_set_skip_frac_num(SpeexResamplerState *st,
spx_uint32_t skip_frac_num);
/** Reset a resampler so a new (unrelated) stream can be processed. *@paramstResamplerstate
*/ int speex_resampler_reset_mem(SpeexResamplerState *st);
/** Returns the English meaning for an error code *@paramerrErrorcode *@returnEnglishstring
*/ constchar *speex_resampler_strerror(int err);
#ifdef __cplusplus
} #endif
#endif
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.19 Sekunden
(vorverarbeitet am 2026-08-26)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.