📜 ⬆️ ⬇️

Speech and VoiceOver on Mac OS X in Russian

I did something for the iPhone and ran into interesting “things”. I quickly adapted these “things” for Mac OS X (for fun), and this is what happened ... Speech and VoiceOver in Mac OS X are in Russian. Someone this may be useful. You can find many uses, but it all depends on your needs.



I will break this small article into two parts. One part for ordinary users who just want to install support for Russian speech in Mac OS X. And for novice developers, whom I will tell you how the module is arranged and provide the source codes.

For ordinary users
')
System requirements:


Link to synthesizer:
http://www.yuriev.info/synth.zip

Installation

The folder "ruSynthesizer.SpeechSynthesizer" must be copied to the folder
/ Library / Speech / Synthesizers

The “Vasilisa.SpeechVoice” folder must be copied into the folder.
/ Library / Speech / Voices

If any of the folders there, then it needs to be created. You can activate Vasilisa in System Preferences (System Preferences)> Speech.

Minuses:


For novice developers

We will not study and invent anything, but simply take the “finished” and sculpt a synthesizer out of it in 5 minutes.

Microsoft is developing by leaps and bounds web service Microsoft Translator (beta). One of the innovations in the second version is the sounding of the text in Russian. We will use this web service.

We will not study in detail and go into details of the "Speech Synthesis Manager Reference" and "Speech Synthesis Programming Guide" from Apple, but take a ready-made example - SynthesizerAndVoiceExample. This example is in the Xcode v3.1.4 package. This package, to get examples from it, can be downloaded from the Apple site. In later versions, Apple removed all the examples, but put them on their site (SynthesizerAndVoiceExample forgot to put it out).

I post the already finished modified project:
http://www.yuriev.info/ruSynthesizer.zip

In fact, we only need to slightly change a few methods (literally a few lines in each method) into the SynthesizerAndVoiceExample project's SynthesizerSimulator.m file:

- (id)init;
- (void)startSpeaking:(NSString *)string;
- (void)stopSpeaking;
- (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)aBool;


The most important changes in the startSpeaking method. We just make a request to the Microsoft web service and get a sound file.

Additionally, you need to put your appId when accessing the Microsoft web service. It can be obtained free of charge from http://www.bing.com/developers/createapp.aspx

Change the voice module description for the Info-VoiceCF1.plist synthesizer. Change the name, locale and range of spoken characters. The finished file can be taken from the final project.
http://www.yuriev.info/synth.zip

Everything, the basic synthesizer is ready. 5 minutes of work, and someone can be very useful.

Source: https://habr.com/ru/post/91587/


All Articles