TextToSpeech library

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Quin
Addict
Addict
Posts: 1131
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

TextToSpeech library

Post 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 :)
BarryG
Addict
Addict
Posts: 4135
Joined: Thu Apr 18, 2019 8:17 am

Re: TextToSpeech library

Post by BarryG »

I'm using this -> viewtopic.php?t=71402
User avatar
Kiffi
Addict
Addict
Posts: 1486
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: TextToSpeech library

Post 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
Hygge
Quin
Addict
Addict
Posts: 1131
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: TextToSpeech library

Post 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.
Post Reply