SpeechSynthesizer允许通过使用SelectVoiceByHints(VoiceGender, VoiceAge)函数来峰化不同的声音(据我所知
).但是,如果我改变性别和语音年龄,就不会进行定制.
你能解释一下原因吗?如果我做错了什么,这样做的正确方法是什么?
谢谢.
我正在为学生创建一个应用程序。我需要用印地语或马拉地语输入数据。
当用户单击特定主题时,用户应该能够以印地语或马拉地语收听该主题。
我知道如何在 TextToSpeech 中设置语言,例如
Tts.setLanguage(Locale.US);
Run Code Online (Sandbox Code Playgroud)
我需要设置印地语或马拉地语。我的问题是如何
在 TextToSpeech 中使用马拉地语或印地语。请给我任何参考或提示。
现在,这是使用 Chrome 文本转语音引擎的Chrome 应用程序的演示。
而且,这是 我修改此应用程序以作为“扩展”而不是应用程序工作的源代码。但是,tts 似乎不可用。我已在清单文件的“权限”下添加了“tts” 。
{
"manifest_version": 2,
"name": "Text2Speech",
"version": "1",
"minimum_chrome_version": "23",
"icons": {
"16": "icon_16.png",
"128": "icon_128.png"
},
"permissions": ["tts"],
"content_scripts": [
{
"matches": ["http://*/*"],
"js": ["js/jquery-1.7.2.min.js", "js/app.js"]
}
]
}
Run Code Online (Sandbox Code Playgroud)
而且,这是我到目前为止的代码:
$(document).ready(function(){
$(document).on("keypress", function(e) {
if ( e.shiftKey && ( e.keyCode === 108 || e.keyCode === 76) ) {
console.log( "You pressed SHIFT + L" , $(prevElement).text());
saySomething($(prevElement).text());
}
});
});
var prevElement = null;
document.addEventListener('mousemove',
function(e){
var …Run Code Online (Sandbox Code Playgroud) javascript google-chrome text-to-speech google-chrome-extension
我正在开发一款TextToSpeech应用.我在a中写了一段UITextField,然后按下Speak按钮.声音根据文中所写的文字播放UITextField.

但是,当应用程序处于后台模式时,音频将停止播放.如何在后台模式下继续播放声音?类似于音频播放器如何在后台播放歌曲.
我使用以下代码进行文本到语音转换:
#import "ViewController.h"
#import "Google_TTS_BySham.h"
#import <AVFoundation/AVFoundation.h>
@interface ViewController ()
@property (nonatomic,strong)Google_TTS_BySham *google_TTS_BySham;
@property (nonatomic,strong)IBOutlet UITextField *txtString;
@end
@implementation ViewController
#pragma mark - View Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
#pragma mark - Button Tapped event
- (IBAction)btnSpeakTapped:(id)sender{
NSString *str = [NSString stringWithFormat:@"%@",_txtString.text];
self.google_TTS_BySham = [[Google_TTS_BySham alloc] init];
[self.google_TTS_BySham speak:str];
}
Run Code Online (Sandbox Code Playgroud) 按照此处的指南安装 microsoft azure 文本转语音 SDK:https : //docs.microsoft.com/en-us/azure/cognitive-services/speech-service/quickstart-python#install-the-speech-sdk
它说要运行
pip install azure-cognitiveservices-speech
,但不幸的是这会返回
找不到满足 azure->cognitiveservices-speech 要求的版本(来自版本:)未找到与 >azure-cognitiveservices-speech 匹配的发行版
我试过在 ==1.2.0 的末尾添加版本#,并添加--pre。所以:
python -m pip install azure-cognitiveservices-speech --pre
python -m pip install azure-cognitiveservices-speech==1.2.0.
我能够使用python -m pip install azure并且它下载了一大堆模块,但不是认知服务模块。我已经尝试过 python 2.7 和 python 3.7,我还安装了Microsoft Visual C++ Redistributable for Visual Studio 2017。如果有人对如何安装此模块有任何想法,将不胜感激。
这是 pypi 链接:https ://pypi.org/project/azure-cognitiveservices-speech/
python pip text-to-speech microsoft-speech-api microsoft-cognitive
我的钥匙已准备好提出请求并从 Google 的文本中获取语音。
我尝试了这些命令以及更多命令。
这些文档没有提供我发现的 Python 入门的直接解决方案。我不知道我的 API 密钥与 JSON 和 URL 一起去哪里了
他们的文档中的一种解决方案是针对 CURL。. 但是涉及在必须将请求发送回他们以获取文件之后下载txt。有没有办法在 Python 中做到这一点而不涉及我必须返回的 txt?我只希望我的字符串列表作为音频文件返回。
(我把我的实际密钥放在上面的块中。我不打算在这里分享它。)
我和我的朋友正在开发一款应用程序,它使用深度学习和神经网络来帮助视障人士。我们正在寻找一种方法,将神经网络通过智能手机摄像头获得的信息通过语音传回给用户,因此我们需要进行 TextToSpeech。
然而,对于用户来说,让应用程序离线工作是一件非常非常大的事情,并且应用程序的所有其他部分都能够在没有互联网连接(神经网络等)的情况下运行,我们正在寻找一种方法来执行 TextToSpeech离线。该应用程序也是俄语的,所以能够支持多种语言的东西就太好了。
如果您能提供有关在 Android Studio 中从何处开始使用 Android 上的离线 TextToSpeech 的任何提示,我们将不胜感激,谢谢!
我正在尝试将音频转换为文本。音频不是英语,而是荷兰语。我无法将荷兰语音频转换为文本。该代码仅适用于英语音频。我不确定是否需要为代码包含一些功能或选项来识别其他语言。下面是代码:
import speech_recognition as sr
r = sr.Recognizer()
with sr.AudioFile('audio.wav') as source:
audio = r.listen(source)
try:
text = (r.recognize_google)
print(text)
Run Code Online (Sandbox Code Playgroud) 我正在开发一个应用程序,其中我的 textview 由字符串和两个按钮组成。当我单击说话按钮时,文本会转换为语音。但是我想在语音运行时突出显示这个词。
这是我的文本到语音初始化:
textToSpeech = new TextToSpeech(this, new TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
if (status == TextToSpeech.SUCCESS) {
result = textToSpeech.setLanguage(Locale.ENGLISH);
textToSpeech.setOnUtteranceProgressListener(new UtteranceProgressListener() {
@Override
public void onStart(String utteranceId) {
Log.d(utteranceId, "TTS start");}
@Override
public void onDone(String utteranceId) {
Log.d(utteranceId, "TTS done");}
@Override
public void onError(String utteranceId) {
});
} else {
Toast.makeText(getApplicationContext(), "Feature is not Available", Toast.LENGTH_SHORT).show();
}
}
});
Run Code Online (Sandbox Code Playgroud)
和其他代码:
private void speak() {
if (result == TextToSpeech.LANG_MISSING_DATA || result == …Run Code Online (Sandbox Code Playgroud) 我在 WindowsPowerShell 和 PowerShell 中都有相同的 profile.ps1。它包括调用 Windows Text-To-Speech 的命令,但是,这些命令在 PowerShell 7 中运行时会失败。
当我尝试使用我使用以下代码创建的 $PomrptTTS 对象时会发生错误:
Add-Type -AssemblyName System.speech
$PromptTTS = New-Object System.Speech.Synthesis.SpeechSynthesizer
Run Code Online (Sandbox Code Playgroud)
在 PowerShell 7 中,任何访问或使用我的 $PormptTTS 对象的尝试都会产生以下结果:
SetValueInvocationException: ....\profile.ps1:82
Line |
82 | $PromptTTS.Rate = 0 ; $PromptTTS.Speak("Time for the $((Get-Date).DayofWeek) shuffle")
| ~~~~~~~~~~~~~~~~~~~
| Exception setting "Rate": "Object reference not set to an instance of an object."
MethodInvocationException: ....\profile.ps1:82
Line |
82 | … e = 0 ; $PromptTTS.Speak("Time for the $((Get-Date).DayofWeek) shuffle")
| ~~~~~~~~~~~~~~~~~~~~
| Exception calling …Run Code Online (Sandbox Code Playgroud) text-to-speech ×10
android ×3
python ×3
java ×2
api ×1
c# ×1
highlight ×1
ios ×1
javascript ×1
locale ×1
objective-c ×1
pip ×1
powershell ×1
regional ×1
set ×1
windows ×1