Go to the Next Level: The ‘do‑say‑go’ Library Brings Text‑to‑Speech to the Go Ecosystem
Share this article
The rise of voice in Go
Voice interfaces have become ubiquitous, from smart assistants to accessibility tools. Yet, the Go ecosystem has historically lacked a straightforward, cross‑platform TTS library. The GitHub‑hosted project do‑say‑go (https://do‑say‑go.github.io/insights/) aims to fill that gap.
“We wanted a library that was as simple to use as the standard library, but powerful enough to support multiple platforms,” says the project maintainer, a seasoned Go engineer.
How it works
do‑say‑go abstracts the intricacies of platform‑specific TTS engines behind a single Go interface. Under the hood, it calls:
- macOS:
saycommand - Linux:
espeakorpico2wave - Windows: SAPI via COM bindings
The library exposes a minimal API:
import "github.com/dosaygo/do-say-go"
func main() {
err := doSayGo.Say("Hello, world!")
if err != nil {
log.Fatal(err)
}
}
The Say function streams audio directly to the default output device, making it ideal for CLI utilities and server‑side voice notifications.
Why it matters
- Cross‑platform consistency – Developers no longer need to write separate code paths for each OS.
- Zero external dependencies – The library relies only on native binaries that are typically pre‑installed, reducing deployment complexity.
- Extensibility – The design allows plugging in custom engines, enabling future support for advanced TTS services like Amazon Polly or Google Cloud TTS.
In the context of micro‑services, adding voice output can improve user experience for accessibility and real‑time alerts. For example, a Go‑based IoT hub could announce sensor thresholds directly through the device’s speakers.
Community and future roadmap
The project is open for pull requests, and the maintainers have already received contributions for Windows support and a fallback mechanism when native engines are missing. The roadmap includes:
- Voice‑over‑IP (VoIP) integration – streaming TTS over RTP.
- Custom voice profiles – selecting different voices on the same platform.
- Unit testing utilities – mocking the underlying engine for CI pipelines.
“Our goal is to make voice as first‑class as HTTP in Go,” the maintainer notes.
Bottom line
do‑say‑go exemplifies how a focused open‑source effort can rapidly elevate a language’s ecosystem. By providing a simple, dependable TTS layer, it empowers Go developers to add voice to their applications without leaving the comfort of the language they already trust.
*Source: https://do-say-go.github.io/insights/