标签: text-to-speech

连续调用TextToSpeech.OnInitListener.onInit(int)

我得到的报道称,在一些(并非所有)HTC Desire HD(FRF91,2.2)和HTC EVO 4G(PC36100 | 3.29.651.5,2.2)上,TextToSpeech.OnInitListener.onInit(int)被重复调用(在少数几个空间内超过1500次)秒)在同一个对象上.任何我的其他用户(或与其他Desire HD用户)AFAICT不会发生此问题.

代码是:

TextToSpeech tts = new TextToSpeech(context, new TextToSpeech.OnInitListener() {
    private int mCallCount = 0; // trying to investigate potential infinite loops

    @Override
    public void onInit(int status) {
        if ((mCallCount % 100) == 1) {
            // report this
        }
        mCallCount++;
    }
});
Run Code Online (Sandbox Code Playgroud)

任何想法?

编辑:我也试过调用该shutdown()方法(第一次检测到多个侦听器调用)但这似乎没有帮助.

android text-to-speech

25
推荐指数
1
解决办法
6946
查看次数

文本到语音Web API

我想要一个可以在网络上运行的文本语音API.谷歌翻译非官方API不合适,因为我需要阅读多个段落,并且它们仅限于100个字符.

我查了一下iSpeech,但是他们需要打个电话来购买积分,因为这项工作维护人员不会说英语,这种计费/销售非常荒谬,我期待着另一种选择.

任何人?

编辑:它必须有一个pt-BR语音.

api text-to-speech

25
推荐指数
2
解决办法
4万
查看次数

使 `say` 终端实用程序和 NSSpeechSynthesizer 与 Siri 语音一起工作

  • 从macOS 11 (Big Sur) 开始,say命令行实用程序似乎不知道 Siri 的声音:

    • say -v '?' 没有列出 Siri 的声音。

    • 明确针对 Siri 语音不起作用:

      • say -v NoraSiri hi! 找不到 Nora Siri 语音(这是默认的 Siri 语音)。
    • 使用捆绑 ID(例如,com.apple.speech.synthesis.voice.custom.siri.nora.premium[1]不会抱怨未知声音,但语音输出失败并显示Open speech channel failed: -86

      • say -v com.apple.speech.synthesis.voice.custom.siri.nora.premium hi!

      • 表面上,任何带有前缀的字符串都会com.apple.speech.synthesis.voice.custom触发这个错误。

  • 同样,NSSpeechSynthesizer不将 Siri 语音列为可用,也不支持选择一种语音输出。

MacOS的大苏尔本身能够使用Siri语音TTS对的,就证明了的事实,你可以选择一个作为系统的声音System Preferences > Accessibility > Speech,例如,在与基于快捷键组合Speak selected text when the key is pressed功能。
(但奇怪的是,如果您右键单击文本并从上下文菜单中选择并且可能也不适用于其他辅助功能,则被选为系统语音的 Siri 语音不会生效- 这种差异是 …

macos text-to-speech siri macos-catalina nsspeechsynthesizer

24
推荐指数
2
解决办法
2709
查看次数

pyttsx:没有名为'engine'的模块

我正在尝试使用来安装TTS包.在我尝试执行以下命令之前一切正常:

import pyttsx
Run Code Online (Sandbox Code Playgroud)

我收回了这个错误:

File "/usr/local/lib/python3.4/dist-packages/pyttsx/__init__.py", line 18, in module <br>
    from engine import Engine<br>
ImportError: No module named 'engine'
Run Code Online (Sandbox Code Playgroud)

任何帮助,将不胜感激.谢谢!

text-to-speech speech-synthesis python-3.4

22
推荐指数
6
解决办法
4万
查看次数

如何暂停android.speech.tts.TextToSpeech?

我正在用android TTS播放文字 - android.speech.tts.TextToSpeech

我用:TextToSpeech.speak说话和.stop停止.有没有办法暂停文本?

android text-to-speech

21
推荐指数
5
解决办法
3万
查看次数

是否有可能使"HTML to speech"与"Text to speech"相同?

我有一个奇怪的要求,在我现有的应用程序Text2Speech中,我已经习惯AVSpeechSynthesizer了语音文本,但现在我的客户要求他想要语音HTML文件,因为他有很多HTML文件DB.

我的建议:

使用HTML解析并从HTML获取所有文本并使用Text2Speech的相同框架.

但客户端不希望这种类型的解析,他想要任何API直接提供HTML2Speech功能的框架.

任何建议或帮助将受到高度赞赏.

html text-to-speech ios

19
推荐指数
1
解决办法
753
查看次数

Android"说话失败:没有绑定tts引擎"

我的Android应用程序具有文本说话功能,并且超过一个活动使用此功能.因此创建了一个静态助手类来简化这一过程.

import java.util.Locale;

import android.content.Context;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.util.Log;

public class TextToSpeechController implements OnInitListener {

    private static final String TAG = "TextToSpeechController";
    private TextToSpeech myTTS;
    private String textToSpeak;
    private Context context;

    private static TextToSpeechController singleton;

    public static TextToSpeechController getInstance(Context ctx) {
        if (singleton == null)
            singleton = new TextToSpeechController(ctx);
        return singleton;
    }

    private TextToSpeechController(Context ctx) {
        context = ctx;
    }

    public void speak(String text) {
        textToSpeak = text;

        if (myTTS == null) {
            // currently can't change Locale …
Run Code Online (Sandbox Code Playgroud)

android text-to-speech

18
推荐指数
2
解决办法
2万
查看次数

Does iOS provide built in text to speech support or any class like NSSpeechRecognizer?

i have found many libraries like flite which can be be used, as in given here, but I want to know if there is any Built-In class provided by iOS SDK similar to NSSpeechRecognizer provided in OS X.

speech-recognition text-to-speech ios

18
推荐指数
1
解决办法
8348
查看次数

带有API 21的TextToSpeech

有人可以帮我使用带有API 21的TTS.所有可用的示例都不推荐使用版本21

这是我的代码在最后一行给出错误:

Calendar cal = Calendar.getInstance();
                    cal.getTime();
                    SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
                    String text = sdf.toString();
                    btn.setText("Ouvir as Horas");

                    TextToSpeech tts = new TextToSpeech(NightClock.this,(TextToSpeech.OnInitListener) NightClock.this);
                    tts.setLanguage(Locale.US);
                    tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
Run Code Online (Sandbox Code Playgroud)

在Android开发人员中,它表示不推荐使用此方法,并将其替换为:

speak(String text,int queueMode,HashMap params)此方法在API级别21中已弃用.从API级别21开始,由speak(CharSequence,int,Bundle,String)取代.

有人可以帮我编写我的应用程序.

api android text-to-speech

18
推荐指数
4
解决办法
3万
查看次数

TextToSpeech:API Level 21中不推荐使用的发言功能

我尝试在我的应用中使用TextToSpeech,

String text = editText.getText().toString();
tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
Run Code Online (Sandbox Code Playgroud)

但函数说(String text,int queueMode,HashMap params)在API Level 21中已被弃用.而不是这样,建议使用speak(CharSequence text,int queueMode,Bundle params,String utteranceId).但我不知道如何设置它.谢谢

android text-to-speech

18
推荐指数
1
解决办法
1万
查看次数