0

我有一个使用 OpenEars API 读取文本的 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;
    }

}

有任何想法吗?

4

1 回答 1

2

OpenEars 开发人员在这里。您无法使用 FliteController 即时更改音高,因为音高是在处理语音之前设置的。

于 2013-05-09T11:33:57.513 回答