孟加拉语内容的 TTS 在我的 Nexus 5x 中运行良好,但在其他手机中则不然。在其他即三星手机只能说英语单词但跳过(不说)孟加拉语单词。
任何人都可以获取此类问题,请帮助我。
谢谢。
代码:
@Override
public void onInit(int i) {
if (i == TextToSpeech.SUCCESS) {
int result = mTextToSpeech.setLanguage(new Locale("bn_IN"));///sf/ask/558111641/
floatRead.setImageResource(R.drawable.ic_volume_off);
if (result == TextToSpeech.LANG_MISSING_DATA
|| result == TextToSpeech.LANG_NOT_SUPPORTED) {
Log.i("TTS", "This Language is not supported");
AppApplication.getInstance().showToast("This Language is not supported");
}
read(mNewsDetails.title, true);
read(mNewsDetails.plain_text, false);
} else {
floatRead.setImageResource(R.drawable.ic_read);
}
}
Run Code Online (Sandbox Code Playgroud)
`
void read(String text, boolean flush) {
if (flush == true) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP)
mTextToSpeech.speak(text, TextToSpeech.QUEUE_FLUSH, null, null);
else
mTextToSpeech.speak(text, TextToSpeech.QUEUE_FLUSH, …Run Code Online (Sandbox Code Playgroud) 我首先要说的是,我在 C# 编程方面非常新手。我正在开发一个应用程序,用于使用 C# 结合 SAPI v5.4 ( speechlib ) 以编程方式修改 Windows 语音词典。到目前为止,一切都运行良好,但我需要更深入地了解字符串在合成(有声)时如何解释。
我的理解是,在 SAPI 5.4 中,单词被分解为音素表示,并且我在使用音素正确“训练”单词发音方面取得了一些成功。我还知道我可以手动将单词添加到 Windows 语音识别词典中,提供录音,然后提取单词的发音(音素)...但这很麻烦。探索默认情况下如何合成单词也很有用,即没有我的输入(例如合成器如何解释“海豚”?)。
从编码的角度来看,这是我到目前为止所得到的:
using System;
using System.Speech.Synthesis;
namespace SpeechTest
{
class Program
{
static void Main(string[] args)
{
// Set up the speech synthesizer
SpeechSynthesizer synthesizer = new SpeechSynthesizer();
synthesizer.Volume = 100;
synthesizer.Rate = -2;
// Configure the audio output
synthesizer.SetOutputToDefaultAudioDevice();
// Initialize string to store word of interest (not in the speech dictionary)
string myWord = "dolphins";
// Speak the …Run Code Online (Sandbox Code Playgroud) AVSpeechSynthesizer 被标记为可在 macOS Mojave beta 上使用。
此前,它仅适用于 iOS、tvOS 和 watchOS。但是,如果我在 Xcode 10 中准备一个小型 macOS 测试项目,则会出现错误“使用未解析的标识符‘AVSpeechSynthesizer’”。在顶部,我有:
import Cocoa
import NaturalLanguage
import AVFoundation
Run Code Online (Sandbox Code Playgroud)
我的代码是:
let string = "Mickey mouse went to town"
let recognizer = NLLanguageRecognizer()
recognizer.processString(string)
let language = recognizer.dominantLanguage!.rawValue
let speechSynthesizer = AVSpeechSynthesizer()
let utterance = AVSpeechUtterance(string: string)
utterance.voice = AVSpeechSynthesisVoice(language: language)
speechSynthesizer.speak(utterance)
Run Code Online (Sandbox Code Playgroud)
它与 iOS 上的代码完全相同,但在 iOS 上它可以工作,在 macOS 上它会给出错误。任何帮助深表感谢。谢谢
我尝试更换扬声器,但我没有在SpeechSynthesizer课堂上列出所有已安装的扬声器(乔治、苏珊、雅库布),另一方面,我有一个根本没有安装的扬声器(齐拉)。
这里发生了什么事?我可以以某种方式将特定的扬声器添加到我的项目中(例如作为 .dll 或其他内容)以不依赖于计算机语言/区域吗?
用于扩展( https://developer.chrome.com/extensions/tts)和SpeechSynthesis(https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis )API的chrome.tts似乎是能够做同样的事情。除了可用功能上的一些差异之外,我确实没有看到任何差异,但它们仍然可以做同样的事情。有什么我应该注意的差异吗?
编辑:我需要专门用于 chrome 扩展程序,我知道 chrome.tts 仅适用于 chrome 扩展程序/应用程序。
javascript google-chrome text-to-speech google-chrome-extension
我知道像 Google Text to Speech 这样的库。然而,这在 Colab 中却不起作用。我最近在 Colab https://colab.research.google.com/github/tugstugi/pytorch-dc-tts/blob/master/notebooks/EnglishTTS.ipynb#scrollTo=jLU2p4Gq_12d中遇到了一个复杂的笔记本,我们可以在其中转换文本到演讲。但是,是否有一种简单的方法可以使用 Google Text to Speech 或 Google Colab 中的其他库?
这样我就提供了一个 String-"My name is XYZ"并在 Colab 笔记本中读出它。(这发生在我提供的链接中,但相当复杂)。
PS 如果可能的话,我希望音频能够自动播放,就像 GTTS 那样。在此笔记本中,我们需要单击“播放”按钮来输出语音。
python text-to-speech google-cloud-platform google-colaboratory gtts
我想使用 SpeechSynthesisUtterance 阅读我的页面文本。
\n\n我找到了这个脚本:https://www.hongkiat.com/blog/text-to-speech/
\n\n几乎完美,但暂停按钮似乎没有多大作用,我希望我能够设置语言,也许还可以选择声音。
\n\n我在这里找到了参考: https: //developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance,但我对 JavaScript 不是很了解。
\n\n对于语言,据我了解,应该使用html标签中设置的lang参数。
\n\n对于语音我完全不知道如何在代码中实现它。
\n\n这很重要,因为我有英语、西班牙语、法语和意大利语的文本,而没有语音和语言设置的结果有时听起来很奇怪。
\n\n这些天我摆弄了一下,我设法(或多或少)组合了两个不同的脚本/示例。
\n\n这个:https: //www.hongkiat.com/blog/text-to-speech/
\n\n这是: https: //developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis#Examples
\n\n出来的代码是这样的:
\n\n超文本标记语言
\n\n<html>\n<head>\n<link rel="stylesheet" href="style.css">\n<script src="text-to-speech.js"></script>\n</head>\n<body>\n<div class=buttons>\n <button id=play></button> \n <button id=pause></button> \n <button id=stop></button>\n</div>\n <select id="voices">\n\n </select>\n<div id="description">\nThe SpeechSynthesis interface of the Web Speech API is the controller interface for the speech service; this can be used to retrieve information about the synthesis voices …Run Code Online (Sandbox Code Playgroud) 是否可以在 iOS 应用程序中自动加载新的语音合成语音?多种高质量的“增强”声音可供下载Settings > Accessibility > Spoken Content > Voices > English。我想使用其中一种高质量的应用程序,但不想向应用程序用户解释他们必须通过深入“设置”导航来手动下载它们。
Siri 声音似乎是我手机上预装的唯一高质量声音,不幸的是 Apple 不允许我们在 AVSpeech\xe2\x80\x8bSynthesizer 中使用这些声音。(选择其中之一作为 AVSpeechSynthesisVoice\xe2\x80\x94 例如
\n\nlet utterance = AVSpeechUtterance(string: "This is a test.")\nutterance.voice = AVSpeechSynthesisVoice(identifier: "com.apple.ttsbundle.siri_female_en-US_premium")\nspeechSynthesizer.speak(utterance)\nRun Code Online (Sandbox Code Playgroud)\n\n没有影响;而是使用质量较低的默认语音。)
\n如果您关注这篇文章https://blog.rasa.com/how-to-build-a-voice-assistant-with-open-source-rasa-and-mozilla-tools/
它会让您从以下位置下载一个 80MB 的文件:
https://drive.google.com/drive/folders/1GU8WGix98WrR3ayjoiirmmbLUZzwg4n0
被称为best_model.pth.tar
并使用https://github.com/mozilla/TTS
你会听到“sara”的声音(非常令人印象深刻)
是否还有其他带有其他预训练声音的 best_model.pth.tar 文件?类似于 CSS 主题,您可以下载一些或免费、付费或非常好的主题,我们是否在某处有预先训练的 TTS 模型目录?
使用 OpenAI API 及以下是我的简单代码,但收到“steam_to_file”方法的弃用警告。
代码 -
from openai import OpenAI
from pathlib import Path
client = OpenAI(
api_key=os.getenv("OPENAI_API_KEY"),
)
speech_file_path = Path(__file__).parent / "speech.mp3"
response = client.audio.speech.create(
model="tts-1",
voice="alloy",
input= '''I see skies of blue and clouds of white
The bright blessed days, the dark sacred nights
And I think to myself
What a wonderful world
'''
)
response.stream_to_file(speech_file_path)
Run Code Online (Sandbox Code Playgroud)
IDE——Visual Studio 代码
警告如下 -
** DeprecationWarning:由于错误,此方法实际上并不传输响应内容,.with_streaming_response.method()应使用 response.stream_to_file("song.mp3")**
有人可以帮忙吗?
我尝试检查不同的论坛,但找不到与stream_to_file相关的错误。
我正在使用Python 3.12
text-to-speech ×10
c# ×2
javascript ×2
python ×2
swift ×2
android ×1
cocoa ×1
gtts ×1
ios ×1
macos ×1
openai-api ×1
python-3.x ×1
rasa ×1
voice ×1