UniversalSpeech - speak to screen readers

Share your advanced PureBasic knowledge/code with the community.
Quin
Addict
Addict
Posts: 1133
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

UniversalSpeech - speak to screen readers

Post by Quin »

There's a library, called Universal Speech, for outputting to multiple different screen readers on the Windows platform. Normally it ships as a DLL alongside the DLLs needed to call out to screen readers, but a friend and me managed to compile it as a static library for inclusion into a project, and I wrapped it into PB.

Code: Select all

ImportC "oldnames.lib"
strnicmp(String1.p-Ascii, String2.p-Ascii, Count)
EndImport

Import "UniversalSpeechStatic.lib"
speechSay(Text.p-Unicode, Interrupt)
brailleDisplay(Text.p-Unicode)
speechStop()
EndImport

Procedure BrailleText(Text$)
brailleDisplay(Text$)
EndProcedure

Procedure SpeakText(Text$, Interrupt = #False)
speechSay(Text$, Interrupt)
EndProcedure

Procedure OutputText(Text$, Interrupt = #False)
BrailleText(Text$)
SpeakText(Text$, Interrupt)
EndProcedure

Procedure StopSpeech()
speechStop()
EndProcedure
You can download the lib file, all the needed DLLs, and the PB file from here: https://quinbox.xyz/pb/usl.zip
Enjoy, and may this make more PB applications accessible!
:)
User avatar
idle
Always Here
Always Here
Posts: 5891
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: UniversalSpeech - speak to screen readers

Post by idle »

That could be useful thanks
Post Reply