B4A Library ICOSTextToSpeech

ICOSTextToSpeech v1.90.

the zip include:

1 - Demo.
2 - Library.
3 - license.

Giuseppe Salvi
Version: 1.9
  • ICOSTextToSpeech
    • Ready (Success As Boolean)
    • ChangeDefaultLanguage (title As String, title1 As String)
      Programmatically change the default language of your phone with that choice yourself.
    • InitializeTTs (EventName As String, lang As String)
      Initialize the object
    • IsSpeaking As Boolean
      Return true if tts is Speaking
    • LanguageSettings
      Go into the language settings.
    • Pause
      Pauses playback.
    • ReadAndSpeakSMS (title As String, title1 As String, title2 As String, title3 As String, title4 As String)
      Read And Speak SMS
    • Resume
      resumes playback.
    • SetLanguageToSpeak (title As String, title1 As String)
      Sets the text-to-speech language.
    • ShutDown
      Release the Engine
    • ShutUp
      Reinitialize the Object
    • Start
      Starts playback from the beginning.
    • Stop
      Stops playback.
    • WriteAndSpeakText (title As String, title1 As String, title2 As String, title3 As String, title4 As String)
      Write and speak some text.
    • DefaultEngine As String [read only]
      Gets the package name of the default speech synthesis engine.
    • EngineByPackageName As String [write only]
      This method was deprecated in API level 14. This doesn't inform callers when the TTS engine has been initialized.
      can be used with the appropriate engine name.
      Also, there is no guarantee that the engine specified will be loaded.
      If it isn't installed or disabled, the user / system wide defaults will apply.
    • PitchToSpeak As Float [write only]
      Sets the speech pitch for the TextToSpeech engine.
    • RateToSpeak As Float [write only]
      Sets the speech rate.
    • Speaks As String [write only]
      Synthesizes the given text to a file using the specified parameters.
    • Version As String [read only]
      Author and Version of the library


  • ICOSTextToSpeech.zip
    62.8 KB · Views: 461
  • ICOSTextToSpeech v1.80.zip
    77.7 KB · Views: 258
  • ICOSTextToSpeech v1.90.zip
    78.1 KB · Views: 453
Last edited:


Licensed User
Hi Lonelystar,

Good to hear from you! Can you please include a mode in your library to make ICOS-TTS speak in either the left or right audio channel. My solution in #21 works, but I think it will work faster if you integrate something like this into your source code. By the way: how do you intercept the TTS audio output and store it in a WAV file? You somehow have managed to make a bridge between the TTS audio output and the audiorecorder, which some people have claimed not to be possible (in other threads). Erel stated that it is only somehow possible via the microphone, but your solution results in excellent audio quality.

Other question: do you know of a way to play a WAV file (or TTS output) via het phone audio channel? I want to make a phone answering machine. You seem to know a lot about how to route oIr intercept audio.


Well-Known Member
Licensed User
Longtime User
Hi Lonelystar,
Can you allow the Readandspeak to read any wav/mp3 file?
like: tts.ReadAndSpeak(FolderName, FileName)
and still have it fire the events?


Licensed User
Longtime User
Last edited: