GUIDE

Text to speech in Google Colab, without installing anything

Not everyone can install software: a Chromebook, a school laptop or a locked work computer may only have a browser. Google Colab runs Python notebooks in the cloud, and the SuperClonica engine installs there like on any Linux computer.

This guide shows how to voice text in a Colab notebook, play it in the browser, voice long texts with catalog voices and save the results, and when running the engine on your own computer is the better choice.

Why Colab

Colab is a quick way to try the engine; for regular work, a local install is faster to start and fully private.

  • Nothing to install on your computer: a browser is enough.
  • Works from a Chromebook or a laptop where you cannot install software.
  • The engine runs on the free CPU runtime; no graphics card is needed.
  • Results can be saved to Google Drive.

Try a voice first

Before you open a notebook, try voices on their pages: type a line of 30 to 100 characters, choose the language and press Voice it. In a few seconds you hear the voice, with no account.

Run it in a notebook

Create the engine once per session: loading takes a few seconds, each later phrase a fraction of a second.

  • In the first cell, install the engine: !pip install superclonica-cpu.
  • In the next cell: from superclonica import Superclonica; tts = Superclonica(); audio, sample_rate = tts.synthesize("Hello from a notebook!", voice="F1", lang="en"); tts.save("hello.wav", audio). The first run downloads the model, about 385 MB.
  • Play the result in the notebook: from IPython.display import Audio, then Audio("hello.wav").
  • Download the file from the files panel on the left.

Long texts and your own voices

Upload a text file or a catalog voice file through the files panel, then voice it: audio, sample_rate = tts.synthesize(open("chapter.txt").read(), voice="narrator.json", lang="en"), and tts.save("chapter.mp3", audio). Long texts are split at natural pauses and joined into one file. To keep the results, mount Google Drive with from google.colab import drive and drive.mount("/content/drive"), and save there.

Limits and privacy

Colab runs on Google’s servers, so your text leaves your computer; for private documents, run the engine locally instead. Free Colab sessions have time and usage limits and disconnect when idle, so save results as you go.