ios - Change OpenEars pitch dynamically (on the fly) -
i have ios app reads text using openears api. using latest version (1.2.5). can not figure out how change pitch while words being read ("on fly"). created slider control pitch. delegate fired slider changed. in delegate function, flitecontroller target_mean changed. intent have pitch change target_mean value changed. code follows:
-(void)saythemessage:(nsstring *)message { // if there nothing there, don't try if (message == nil) return; [self.oeeo setdelegate:self]; // going in label... @try { // set pitch, etc... self.flite.target_mean = pitchvalue; // change pitch self.flite.target_stddev = variencevalue; // change variance self.flite.duration_stretch = speedvalue; // change speed // it! [self.flite say:message withvoice:self.slt]; } @catch (nsexception *exception) { if ([delegate respondstoselector:@selector(messageerror)]) [delegate messageerror]; } @finally { } } -(void)changepitch:(float)pitch { if ((pitch >= 0) && (pitch <= 2)) { // save new pitch internally pitchvalue = pitch; // change pitch of current speaking.... self.flite.target_mean = pitchvalue; } }
any ideas?
openears developer here. can't change pitch on fly flitecontroller since pitch set before speech processed.
Comments
Post a Comment