How to make app speak in IOS



We will use same AVSpeechSynthesizer class that availabe on iPhone and iPad. It is very easy to make app speak on iOS. You can make the app to say what ever you want. It is based on siri text to speech technology.  If you want to make your app speak, just add the following code in the ViewController.swift files.



//  ViewController.swift

//  Text2Speech


//  Created by Hafiz on 06/10/2016.

//  Copyright © 2016 HafizRich. All rights reserved.



import UIKit

import AVFoundation

class ViewController: UIViewController {


        override func viewDidLoad() {


            let utterance = AVSpeechUtterance(string: "Hello world")

            utterance.voice = AVSpeechSynthesisVoice(language: "en-GB")

            utterance.rate = 0.1


            let synthesizer = AVSpeechSynthesizer()




    override func didReceiveMemoryWarning() {


        // Dispose of any resources that can be recreated.







How to make app speak in IOS How to make app speak in IOS Reviewed by Admin on 11:39 AM Rating: 5

No comments:

Powered by Blogger.