Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't get text to speech to work

Tags:

swift

I get the following message when I try the code below:

2014-07-28 13:19:14.251 MySingleView[3750:461865] Speech initialization error: 2147483665

Am I doing something wrong, or is this a bug?

I'm running this in an iPad 2 simulator on my Mac running Mavericks using Xcode6 - Beta 4.

import UIKit
import AVFoundation

class ViewController: UIViewController {
    var voice = AVSpeechSynthesizer()

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

    @IBAction func buttonPushed(sender: UIButton) {
        var utterance = AVSpeechUtterance(string:"This is a test")
        voice.speakUtterance(utterance)
    }
}
like image 931
Joe H Avatar asked Jul 28 '14 17:07

Joe H


People also ask

Why speech to text is not working?

Speech Recognition (Speech-to-Text aka STT) Check the following in your system settings: Look under 'Language & Input'. In some cases it might be under Gboard. Find "Google Voice Typing", make sure it's enabled.

Why is my speech recognition not working?

Here are some things to check first if voice typing isn't working: Make sure the microphone you want to use is selected in Settings. To check, select Start > Settings > System > Sound > Input > Choose a device for speaking or recording.

How do I get text to speech to work on my computer?

Press Windows key + Ctrl + Enter, and Narrator starts reading the text on the page to you. Stop Narrator from speaking by pressing the same shortcut.


1 Answers

The iOS 8 simulators do not support text-to-speech. However, the iOS 7 simulators do still support text-to-speech (at least as of Xcode 6.1), so if your app works under iOS 7 you can test it on your desktop.

like image 89
John Brewer Avatar answered Oct 22 '22 09:10

John Brewer