117 SG_CLAMP_RANGE( volume, 0.0, 1.0 );
118 SG_CLAMP_RANGE( speed, 0.0, 10.0 );
119 SG_CLAMP_RANGE( pitch, 0.0, 10.0 );
120 HTS_Engine_set_volume( &_engine->engine, _volume );
121 HTS_Engine_set_speed( &_engine->engine, 0.8 + 0.4 * speed );
122 HTS_Engine_add_half_tone(&_engine->engine, -4.0 + 8.0 * pitch );
127 if ( FALSE == Flite_HTS_Engine_synthesize_samples_mono16(_engine, text.c_str(), &data, &count, &rate))
return NULL;
129 auto buf = std::unique_ptr<
unsigned char,
decltype(free)*>{
130 reinterpret_cast<unsigned char*
>( data ),
133 return new SGSoundSample(std::move(buf),
134 count *
sizeof(
short),