Example #1
0
void fextract_destroy(fextract_t *fex) {
	if (fex->mfcc) {
		mfcc_destroy(fex->mfcc);
	}
	if (fex->pitch) 
		pitch_destroy(fex->pitch);
	if (fex->hnr)
		pitch_destroy(fex->hnr);
	if (fex->vq)
		pitch_destroy(fex->vq);
	rs_free(fex);
}
Example #2
0
void EmoVoicePitch::transform_flush (ssi_stream_t &stream_in,
	ssi_stream_t &stream_out,
	ssi_size_t xtra_stream_in_num,
	ssi_stream_t xtra_stream_in[]) {

	pitch_destroy (_cfg);
	_cfg = 0;
}
Example #3
0
 ~resampleBuf()
 {
    if(buf)                 free(buf);
    if(leftBuffer)          free(leftBuffer);
    if(rightBuffer)         free(rightBuffer);
    if(pitch)               pitch_destroy(pitch);
    if(sbsmser)             sbsms_destroy(sbsmser);
    if(outBuf)              free(outBuf);
    if(outputLeftBuffer)    free(outputLeftBuffer);
    if(outputRightBuffer)   free(outputRightBuffer);
    if(outputLeftTrack)     delete outputLeftTrack;
    if(outputRightTrack)    delete outputRightTrack;
    if(resampler)           delete resampler;
 }
Example #4
0
void EmoVoicePitch::transform (ITransformer::info info,
	ssi_stream_t &stream_in,
	ssi_stream_t &stream_out,
	ssi_size_t xtra_stream_in_num,
	ssi_stream_t xtra_stream_in[]) {

	ssi_size_t sample_number = stream_in.num;

	short *srcptr = ssi_pcast (short, stream_in.ptr);
	mx_real_t *dstptr = ssi_pcast (mx_real_t, stream_out.ptr);

	mx_real_t *p = pitch_calc (_cfg, srcptr, sample_number);
	memcpy (dstptr, p, _cfg->nframes * sizeof (mx_real_t));

	pitch_destroy (_cfg);
	_cfg = pitch_create (ssi_cast (pitch_method_t, _options.method));
	_cfg->minimumPitch = ssi_cast (mx_real_t, _options.minfreq);
	_cfg->maximumPitch = ssi_cast (mx_real_t, _options.maxfreq);

	free (p);
}