Bring your karma
Join the waitlist today
HUMBLECAT.ORG

Blind and Visually Impaired Community

Full History - 2021 - 12 - 06 - ID#rafbrs
6
Help creating fake screenreader audio for a prototype (self.Blind)
submitted by kelpangler
Im recording some fake screenreader text to use in a prototype. I figure I’d just type into a doc and have Siri read it while I record. But I’m having trouble putting pauses between paragraphs so it sounds like hint text. I’m using Word on my Mac. Does anyone know of a special character or something like that to force a pause?

It works on my iPad but not on my Mac. Thanks!
Fridux 5 points 1y ago
You can record whatever text-to-speech audio you wish using any of the available speech synthesizers on MacOS using AppleScript as follows.

say "I've got balls of steel!" using "Alex" saving to ((path to desktop folder) & "Balls.aiff") as string

Copy this into Script Editor which you can either launch from Spotlight or from the Utilities folder inside Applications, grant it permission to access files on your desktop if prompted, and an audio file named `Balls.aiff` with the text "I've got balls of steel!" spoken by the Alex voice will be created on your desktop.

For more information on commands you can call from AppleScript you can check out the dictionary available from File -> Open Dictionary or pressing Command+Shift+O in Script Editor. The standard commands I'm using in the above example are all from the `StandardAdditions.sdef` dictionary.

The pitch, intonation, speech rate, and every other aspect of the voice is customizable.

Let me know if you need further assistance.
kelpangler [OP] 1 points 1y ago
Woah, this is way cool! I can’t wait to try this out! As far as creating pauses between sentences or paragraphs (like when you have hint text) is there a way to make that work here? Like can I add return cartridges, spaces, etc.? I’m just trying to avoid creating 2 audio files for just one element being spoken which then needs to be merged together. Thanks!
Fridux 4 points 1y ago
Yes, you can add pauses by including the `[[slnc N]]` embedded speech command where `N` is the number of milliseconds, to the string where you want the synthesizer to pause speaking. You can even make the synthesizer sing if you want to. The relevant information is available from page 26 on Apple's $1 documentation.

Example:

say "I've got balls[[slnc 1000]] of steel!" using "Alex"

Will make the speech synthesizer say "I've got balls of steel!" with a 1 second pause between "balls" and "of", using the Alex voice.
MostlyBlindGamer 2 points 1y ago
Those aliens shouldn't have messed with Alex' motorcycle.
kelpangler [OP] 1 points 1y ago
It works perfectly! So cool that there's even something like this available. Last question… how do I get Siri's voice to work? I tried typing Siri but I'm guessing the actual name must be something different.
Fridux 1 points 1y ago
Some voices, such as the Siri and Compact voices, seem to be off-limits as they are not made available through public APIs like `NSSpeechSynthesizer`, which is what I believe is being used. I was already aware that the Compact voices were not available, but thought that the Siri voices were since they are available in the Accessibility pane in System Preferences. However I did test by entering the exact name of an installed Siri voice and even making it the system default and trying to make it speak through VoiceOver but it did not work, so you'll have to make do with something else like Samantha.
zersiax 1 points 1y ago
You ...literally have a screen reader on your mac, why not just record that?
kelpangler [OP] 1 points 1y ago
We’re using prototyping software that includes the use of wireframes and visual mockups . Sometimes there’s no actual text since it might just be an image. So we basically need to simulate the experience. Does that make more sense?
zersiax 1 points 1y ago
Yeah, I figured that much, but I meant, why not simply record audio of the screen reader built into Mac OS for the sound bites. To get a pause you'd just have to add a comma or a full stop at the end of one of the phrases.
kelpangler [OP] 1 points 1y ago
Well that's exactly what I'm doing. Writing text on my Mac and having Siri read it back to me. My issue is that I'd like to get pauses to work for me. I can use periods or commas but they really don't provide meaningful pauses like what I'd need for hint text. I've tried carriage returns but it seems to just ignore that there are multiple paragraphs. It just reads it all as one paragraph. I'm trying to figure out what I'm missing here.
bradley22 1 points 1y ago
That's not what the person means :)

I'm assuming you're not blind, right? There's a screen reader on the mac called voiceover,, I can't really tell you much about it as i've not used it in years but it does work and allows you to navigate the mac.
This nonprofit website is run by volunteers.
Please contribute if you can. Thank you!
Our mission is to provide everyone with access to large-
scale community websites for the good of humanity.
Without ads, without tracking, without greed.
©2023 HumbleCat Inc   •   HumbleCat is a 501(c)3 nonprofit based in Michigan, USA.