Previously, I had built a text-to-speech app on Windows to help me listen to my Twitch chat while streaming. You can read about the project, why I built it, and download it here. This post is about the macOS version which I built on stream. If you're curious about my streams, follow me on Twitch @techygrrrl.
Features
Multilingual
This text-to-speech app supports all languages that Apple supports by default.
Here's a snippet of code that shows which languages are supported:
.init(name: "Arabic", languageKey: "ar"),
.init(name: "Chinese", languageKey: "zh"),
.init(name: "Czech", languageKey: "cs"),
.init(name: "Danish", languageKey: "da"),
.init(name: "Dutch", languageKey: "nl"),
.init(name: "English", languageKey: "en"),
.init(name: "Finnish", languageKey: "fi"),
.init(name: "French", languageKey: "fr"),
.init(name: "German", languageKey: "de"),
.init(name: "Greek", languageKey: "el"),
.init(name: "Hebrew", languageKey: "he"),
.init(name: "Hindi", languageKey: "hi"),
.init(name: "Hungarian", languageKey: "hu"),
.init(name: "Indonesian", languageKey: "id"),
.init(name: "Italian", languageKey: "it"),
.init(name: "Japanese", languageKey: "ja"),
.init(name: "Korean", languageKey: "ko"),
.init(name: "Norwegian", languageKey: "nb"),
.init(name: "Polish", languageKey: "pl"),
.init(name: "Portuguese", languageKey: "pt"),
.init(name: "Romanian", languageKey: "ro"),
.init(name: "Russian", languageKey: "ru"),
.init(name: "Slovak", languageKey: "sk"),
.init(name: "Spanish", languageKey: "es"),
.init(name: "Swedish", languageKey: "sv"),
.init(name: "Thai", languageKey: "th"),
.init(name: "Turkish", languageKey: "tr")
Support depends on the macOS version and installed voices. At time of development, on macOS 11, the above languages are supported. Please note that not all of them have been tested.
Speed, Volume and Stop Controls
You are able to configure the speed and volume controls on the Listen screen. The recommended speed is 0.5.
You can also stop the app from speaking if it's in the middle of speaking. Note that any already-queued up messages will not be spoken. Once another person sends a message after it's been stopped, they will continue to be read aloud. To stop it entirely, quit the app or lower the volume to 0%.
Noise reduction features
The app includes features to reduce noise from official Twitch emotes. BTTV emotes and unicode emojis not currently supported so they will be read aloud.
Word Replacements
This app has the ability to replace words in text, just like the Windows version I built. It runs on the message text and the username.
This can be useful for the following reasons:
- expand internet slang / short forms
- override username pronunciation
Ignore List
This app adds the ability to ignore usernames. This is useful if you do not want to hear your bots' messages being read aloud.
Download and Install (soon 🤞)
Once I pay for an Apple developer account ($100/yr) to sign and distribute the app, it will become available. Unfortunately, Apple does not allow developers to distribute an app without paying the annual fee. If you need access to a text-to-speech app and have a Windows computer, you can download and install the Windows version. It's available now and is free.
Watch me build it
I built this in 7 streams. Streams ranged from 5 to 9 hours long. It was an epic journey learning SwiftUI and the text-to-speech API's on macOS.
You can watch my journey learning SwiftUI and macOS development on Twitch in the following video collection: twitch.tv/collections/-9v-a8uO8RbfCA
You can also see individual videos:
This is what it looked like on day 1 before the stream started:
Get some code
Code up to day 4 is available to patrons on Patreon (all membership tiers). It's not the final product but contains the core functionality:
- detects language and reads out the message in that detected language
- change volume
- change speed
- word replacement
- ignore usernames
What's missing is the ability to configure which languages you want to listen to (all languages on your computer will be used), as well as the pretty UI.
Become a patron here: patreon.com/techygrrrl
Here's a screenshot of the app on day 4.
I plan on publishing via the mac App Store once I get an Apple developer account so people can have access. It will either be free or offered at a small fee in order to recover costs paid to Apple.
If you want a free text-to-speech app now and you have Windows, you can get my Windows one here. There's also a very quick and dirty one in the browser that is English only and randomizes the voices: lrvbfs.csb.app