我有一个使用OpenEars应用程序接口读取文本的iOS应用程序。我使用的是最新版本(1.2.5)。我不知道如何改变音高,而单词正在被阅读(“在飞行中”)。我创建了一个滑块来控制音高。当滑块改变时,将触发一个代理。在委托函数中,FliteController target_mean被更改。其目的是在target_mean值更改后立即更改音调。我的代码如下:
-(void)sayTheMessage:(NSString *)message {
// if there is nothing there, don't try to say anything
if (message == nil)
return;
[self.oeeo setDelegate:self];
// we are going to say what is in the label...
@try {
// set the pitch, etc...
self.flite.target_mean = pitchValue; // Change the pitch
self.flite.target_stddev = varienceValue; // Change the variance
self.flite.duration_stretch = speedValue; // Change the speed
// finally say 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 the new pitch internally
pitchValue = pitch;
// change the pitch of the current speaking....
self.flite.target_mean = pitchValue;
}
}有什么想法吗?
发布于 2013-05-09 19:33:58
这里是OpenEars开发人员。您不能使用FliteController动态更改音调,因为音调是在语音处理之前设置的。
https://stackoverflow.com/questions/16442992
复制相似问题