Git Product home page Git Product logo

mvspeechsynthesizer's Introduction

MVSpeechSynthesizer

Effective way to use an AVSpeechSynthesizer

Why MVSpeechSynthesizer?

1. Simple way to integrate the AVSpeechsynthesizer into your app.

2. Instead of delgate method it provides block methods.

3. Apart from simple usage it can auto detect the language of given string and read.

4. It can higlight currently reading word.

5. It also throw currently reading word

6. It can auto scroll the page if once reached bottom of the text box.

7. It can read all languages which is supported by AVSpeechSynthesizer

8. It can list all supported langauages and their country name

MVSpeechSynthesizer

MVSpeechSynthesizer in action
MVSpeechSynthesizer in action - It shows highlight the text.

Custom Keyboard


Who need this?

1. Whoever developing kids reading books

2. Whoever wants to read their EULA or privacy policy to their user

3. Whoever developing apps with voice navigation

4. Whoever wants to integrate reading functionality to thier app

Pod Installation

Add the following to your CocoaPods Podfile

pod 'MVSpeechSynthesizer'

Apps Using this control


Custom Keyboard


Secure Notes - Lock your important notes

Let me know if any other using this control(Just drop a mail)

Future enhancement

1. To read any webpage with highlighted text

2. Gives different voices(female and male)

How to use this?

For changing the language use speechLanguage object

For passing the read string use speechString object

For getting supported langauges call supportedLanguages function

for changing the string just copy some other string and paste on text box.

For choosing language just press language button you will navigate to the list of languages page their you can choose language

For enable and disable the highlight use isHighlight object

For changing speech voice uRate and pitchMultiplier objects

Just initialize the MVSpeechsynthesizer class and do the following steps,

    MVSpeechSynthesizer *mvSpeech=[MVSpeechSynthesizer sharedSyntheSize];//Initialize the class
    mvSpeech.higlightColor=[UIColor yellowColor];//Higlght backgroundcolor
    mvSpeech.isTextHiglight=YES;//If you want to highlight set yes, othgerwise set no.
    mvSpeech.speechString=//Pass string which is need to read.
   mvSpeech.inputView=_helpTextView;//Pass the input view which carries the string.
   [mvSpeech startRead];//Initialize the read function.
   mvSpeech.speechFinishBlock=^(AVSpeechSynthesizer *synthesizer, AVSpeechUtterance *utterence){
     //It will call when read action finished.
   };

Let me know if any issues?

mvspeechsynthesizer's People

Contributors

vimalmurugan89 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mvspeechsynthesizer's Issues

The return value type of sharedSynthSize() is AnyObject?

The code is simple as this:

let synthesizer: MVSpeechSynthesizer = MVSpeechSynthesizer.sharedSynthSize()

And it tells me that AnyObject? cannot be converted to MVSpeechSynthesizer. Shouldn't sharedSynthSize() return MVSpeechSynthesizer? Why AnyObject? instead?

License

Please put the MIT license into the project.

The default uRate is not AVSpeechUtteranceDefaultSpeechRate

If I just initialize the synthesizer like this:

var mvSynthesizer = MVSpeechSynthesizer()

And I set the speechString and call startRead. It reads it really slowly. I have to explicitly set the uRate to AVSpeechUtteranceDefaultSpeechRate to get the normal speech rate. Why don't you use AVSpeechUtteranceDefaultSpeechRate as the default value?

Unable to detect Chinese

If I just create an MVSpeechSynthesizer and use all the default settings, it doesn't seem to automatically detect and speak Chinese. Try telling it to read "你好". It produces no sound at all.

Crash on input containing only one word

The sample app crashes when you try to synthesize speech for only one word.

Crash occurs on [ViewController startRead:] line 87.

Issue: speechLanguage is nil.

It seems that NSLinguisticTagger does not find a language for string containing only one word, so [MVSpeechSyntesizer detectLanguage:] returns @"und". As a result _speechLanguage is not found in supported languages and not set in [MVSpeechSyntesizer setSpeechString:] method.

Solution:
The crash occurs when updating Current language labels, so quick and temporay fix would be to add
if (!speechLanguage) {
return ;
}

to mvSpeech.speechStartBlock implementation in [ViewController startRead:]. However to avoid confusion it should be imo covered earlier.

This can be either fixed by setting default language in [MVSpeechSyntesizer detectLanguage:] method (result checking) or in [MVSpeechSyntesizer setSpeechString:] after enumeration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.