Latest 1.0
Homepage https://github.com/WataruMaeda/speaker
License MIT
Platforms ios 8.0
Authors

Speaker

CI Status
Version
License
Platform

Installation

Speaker is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'SpeakerForSpeech’, ‘~> 1.0’

Usage

・Basic Usage

  1. Import Speaker for setup
import Speaker
  1. Pass "text" and "language" to Speaker. That’s all!
Speaker.speak(text: "Hello Speaker", language: "en-US")

Here is a list of supported languages

・Interrupt speech

interrupt can interrupt the speaking if it in the middle of the speech. The default value is false.

Speaker.speak(text: "Hello Speaker", language: "en-US", interrupt: true)

・Speech speed

rate can adjust the speed of the speech. It is ranged from 0.0 to 1.0. Default value is 0.0

Speaker.speak(text: "Hello Speaker", language: "en-US", rate: 1.0)

・Voice pitch

pitch can decide the pitch of the voice. Value range is from 0.5 to 2.0. The default value is 1.0.

Speaker.speak(text: "Hello Speaker", language: "en-US", pitch: 0.5)

・Notice the start and end of the speech

You might like to know when the speech starts and when it ends. In this case, bellow is how to get these callbacks.

Speaker.speak(text: "Hello Speaker", language: "en-US", started: {
print("Started")
})
Speaker.speak(text: "Hello Speaker", language: "en-US", finished: {
print("Finished")
})

You can sets both callbacks

Speaker.speak(text: "Hello Speaker", language: "en-US", started: {
print("Started")
}, finished: {
print("Finished")
})

Requirements

iOS 8+
Swift 3.0+
Xcode 8.0+

License

This project is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SpeakerForSpeech",
    "version": "1.0",
    "summary": "A simplified speech library for AVSpeechSynthesizer",
    "description": ""Speaker" is a speech library with easy usage. You can pass text and language to Speaker so that it starts reading. Completion handlers are for detecting when the sound starts and ends.",
    "homepage": "https://github.com/WataruMaeda/speaker",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "WataruMaeda": "[email protected]"
    },
    "source": {
        "git": "https://github.com/WataruMaeda/speaker.git",
        "tag": "1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "speaker/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This