gpt4 book ai didi

ios - 动态更改 OpenEars 音调(即时)

转载 作者:行者123 更新时间:2023-11-28 22:34:35 26 4
gpt4 key购买 nike

我有一个使用 OpenEars API 读取文本的 iOS 应用程序。我使用的是最新版本 (1.2.5)。我无法弄清楚如何在阅读单词时改变音调(“即时”)。我创建了一个 slider 来控制音高。更改 slider 时会触发委托(delegate)。在委托(delegate)函数中,更改了 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;
}

}

有什么想法吗?

最佳答案

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

关于ios - 动态更改 OpenEars 音调(即时),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16442992/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com