Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text speed #4

Closed
fabien-h opened this issue Jan 1, 2017 · 2 comments
Closed

Text speed #4

fabien-h opened this issue Jan 1, 2017 · 2 comments

Comments

@fabien-h
Copy link

fabien-h commented Jan 1, 2017

Hi, great package !

Would it be possible to change te the speed at will ?

In TextToSpeech.m, after that :

if ( voice ) {
	utterance.voice = [ AVSpeechSynthesisVoice voiceWithIdentifier: voice ];
} else if ( _defaultVoice ) {
	utterance.voice = _defaultVoice;
}

You can add

if ( rate ) {
	utterance.rate = [ rate doubleValue ];
}

And for android it’s going to be tts.setPitch(rate); as far as I understand.

@fabien-h
Copy link
Author

fabien-h commented Jan 6, 2017

Awesome, thank you !

@ak1394
Copy link
Owner

ak1394 commented Jan 6, 2017

Cheers! Thanks goes to @maslianok for the PR. Android uses setSpeechRate(). There are differences between set rate api parameters on ios and android, so I ended up doing some mapping between the two to unify javascript api, therefore max android speech rate which can be set is about x3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants