Monday, 21 October 2019

Marathi (Devnagri) Text to Speech

Marathi TTS methods.

Better of the ones tried so far is the Undocumented (but widely used) Google translate API.

The TTS methods tried so far.
1. Undocumented "Google translate API".
2. CMU_INDIC speech synthesis on the Festival Speech Synthesis System.
3. CDAC JunuBharutee festival-mr package on the Festival Speech Synthesis System.

Undocumented "Google translate API" 

A simple python wrapper to call Google TTS (gTTS) python library recurrsively to overcome the 100 character limit and save output in mp3 format. This results in incorrect pauses, phrasing but found to be acceptable.

CMU_INDIC speech synthesis

Install Festival and the package as per instructions as on the original locations.
$festival
festival>(voice_cmu_indic_mar_aup_cg)
festival>(tts "/home/marathi.txt" nil)

The above will use aplay to output marathi speech.

cp /tmp/audiofile_xxxx temp.raw
To convert the raw to wave
ffmpeg -f s16le -ar 16k -ac 1 -i temp.raw file.wav

Wednesday, 3 April 2019

Scale , Crop , Resize photos for OCI India

Current OCI photo requirements.

... the images must be in jpeg or jpg format, with max size 200kb.

The height and width of the Applicant Photo must be equal.
The minimum dimensions are 200 pixels (width) x 200 pixels (height).
The maximum dimensions are 900 pixels (width) x 900 pixels (height).

Use GIMP - free and brilliant tool on Ubuntu.

Step 1: Open the original photo. File --> Open

Step 2: Crop the Image. Tools --> Transform Tools --> Crop. Select the area of the photo such that height and width is same number of pixels i.e. aspect ration 1:1.

Step 3: Scale the Image. Tools --> Transform Tools --> Scale. Enter height and width as 900px. This will scale the selected photo to 900 by 900 px. 

Step 4: Change the canvas to the layer size. Image --> Fit canvas to Layers.

Step 5: Export the resultant image. File --> Export --> select jpeg , jpg. 

Step 6: Select "Show preview in image window" so that File size is visible. Adjust Quality so that the file size remains under 200Kb.