Recent

Author Topic: LAMW - Text to speech  (Read 4769 times)

freris

  • New Member
  • *
  • Posts: 48
  • A Retired hobbist programmer from Greece
LAMW - Text to speech
« on: October 12, 2017, 02:58:35 pm »
Hi jmpessoa !

Yesterday  i tried the jtexttospeech component. And i have a question.

How hard is to add the ability to add custom language ?  E.g. Greek ?

Thank you so much
As I get older, the more I learn !!

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: LAMW - Text to speech
« Reply #1 on: October 14, 2017, 05:08:57 am »
« Last Edit: October 14, 2017, 05:31:10 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

freris

  • New Member
  • *
  • Posts: 48
  • A Retired hobbist programmer from Greece
Re: LAMW - Text to speech
« Reply #2 on: October 14, 2017, 07:20:35 pm »
Hi jmpessoa !

Yes a solution such https://stackoverflow.com/questions/33118121/android-tts-for-multiple-languages is the best because with a parameter as "SpeechLanguage = Greek" or whatever will be ok. I mean that if had an ability for custom languages, will be best solution.

Yes i know the " jTextToSpeech1.SpeechLanguage:= slDefault "  it is ok but depends of selected phone language.

I prefer to force selected language for my app, because some users had selected other language for their phone and prefer to have the  language selection option inside application.

If its not very hard to add this piece of code in the future, i think that will be very useful for all.

Thank you !
As I get older, the more I learn !!

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: LAMW - Text to speech
« Reply #3 on: October 14, 2017, 11:23:14 pm »


Ok.

Quote
If its not very hard to add this piece of code in the future, i think that will be very useful for all.

Yes, as soon as there is support for more languages in Android Sdk, I will do....
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

c4p

  • Full Member
  • ***
  • Posts: 157
Re: LAMW - Text to speech
« Reply #4 on: October 16, 2017, 03:23:06 pm »
Text to Speech component works great! 
This could be really useful for me in a future project. :)
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: LAMW - Text to speech
« Reply #5 on: October 22, 2017, 05:08:26 am »
Done!

Added new support to google online Text to speech ....

Code: Pascal  [Select][+][-]
  1.       jTextToSpeech1.SpeakOnline('Bom dia Pessoal!', 'pt');   // pt = portuguese
  2.  
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

CC

  • Full Member
  • ***
  • Posts: 149
Re: LAMW - Text to speech
« Reply #6 on: October 22, 2017, 10:02:00 pm »
Nice! 

Is there a way to save the result to a sound file for offline usage.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: LAMW - Text to speech
« Reply #7 on: October 22, 2017, 10:49:40 pm »

You can try join jMediaRecorder component in your  project...
[there is a demo  "AppMediaRecorderDemo1" ]
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

CC

  • Full Member
  • ***
  • Posts: 149
Re: LAMW - Text to speech
« Reply #8 on: October 23, 2017, 11:33:20 am »
Thanks, that seems quite easy. :)

 

TinyPortal © 2005-2018