vimalmurugan89 / mvspeechsynthesizer Goto Github PK
View Code? Open in Web Editor NEWEffective way of using AVSpeechSynthesizer
Effective way of using AVSpeechSynthesizer
Please put the MIT license into the project.
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.
Speech initialization error: 2147483665
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?
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.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.