Page 1 of 1

TextToSpeech library

Posted: Sat Nov 11, 2023 8:09 pm
by Quin
I very often find myself needing to output a message in my application, not on the screen. It would be amazing if we could have a library that wraps all the platform-specific text-to-speech APIs (SAPI 5 and maybe OneCore on Windows, AVSpeechSynthesizer and NSSpeechSynthesizer for macOS, and maybe Espeak or Speechd for Linux) into an easy-to-use interface.

There was a PureLibrary to do this in the PB 4.x days (I think it was called either PureSpeech or PureTTS), but I haven't been able to find it and it was Windows only as far as I know.

This could even be ported to SpiderBasic, taking advantage of the native TTS facilities on the web, iOS and Android.

I probably have more of a use for this than the average user given that I'm blind and speech is my main way of receiving information, but I think it would be useful for everyone :)

Re: TextToSpeech library

Posted: Sun Nov 12, 2023 2:18 am
by BarryG
I'm using this -> viewtopic.php?t=71402

Re: TextToSpeech library

Posted: Sun Nov 12, 2023 2:33 am
by Kiffi
Quin wrote: Sat Nov 11, 2023 8:09 pmThis could even be ported to SpiderBasic, taking advantage of the native TTS facilities on the web, iOS and Android.
A long time ago I wrote a small demo that uses speechSynthesis: https://forums.spiderbasic.com/viewtopi ... 4152#p4152

Re: TextToSpeech library

Posted: Sun Nov 12, 2023 3:40 am
by Quin
BarryG wrote: Sun Nov 12, 2023 2:18 am I'm using this -> viewtopic.php?t=71402
Hmmm... I wonder how hard it would be to do this now that we have the C back-end? Just include the headers and write a fairly simple wrapper, I'd think. Am not 100% certain how you call SAPI from pure C as I've only ever done it from C++, but it's certainly doable.