Using Realtime Text to Speech

Generate and listen to speech as you enter text in the Speech service.

Realtime text to speech lets you send text incrementally and receive audio while you continue entering text. You can use it for interactive applications, such as voice assistants that begin speaking as a response is generated.

In the Console, the Realtime text to speech page starts synthesis automatically when you type or paste text. You can listen as MP3 audio arrives and download the audio after the session ends.

For an application integration, see Using the Realtime Text to Speech API. To submit complete text in one request, with an option to stream the audio response, see Using Text to Speech.

Before You Begin

  • Use a region and tenancy where realtime text to speech is available.
  • Ensure that you have permission to use Speech synthesis and list voices in the selected compartment. For information about access policies, see About Speech Policies.
  • Use a current browser that supports WebSocket connections. Browser autoplay settings might require you to select Play manually.

You don't need to configure Object Storage for this Console workflow.

Generating Audio in the Console

  1. Open the navigation menu  and select Analytics & AI. Under AI Services, select Speech.
  2. Select Realtime text to speech.
  3. Before entering text, configure the following settings. You can't change these settings while a session is active.
    Setting Description
    Compartment Select the compartment to use for synthesis and voice selection.
    Model type Select Natural or Standard. Natural is selected by default.
    Language Select the language of your text. The initial selection is US English. Available languages depend on the model, region, and available voices.
    Speaker Select a voice from the speakers available for your model and language.
    Output format The output is MP3. You can't change this setting on the realtime page.
    Sample rate Enter a whole number from 8,000 through 48,000 Hz. The default is 24,000 Hz for Natural and 22,050 Hz for Standard.
  4. Under Input text, type or paste up to 5,000 characters of plain text. This page doesn't provide SSML or speech-mark settings.

    The first nonblank text starts the connection automatically. Continue entering text while Speech generates audio.

  5. When you have entered all the text, select Finish input. This sends any remaining text and tells the service that no more text will follow.

    The action changes to Finishing... while the session finishes. You can't edit the text during this step.

  6. Wait for Audio complete. Listen with the audio player or select Download Audio to save the MP3 file.

    If playback doesn't start automatically, select Play. If your browser doesn't support live MP3 playback, the audio becomes available after synthesis finishes.

Note

If a session ends with an error, timeout, or connection interruption, the audio available for playback or download can be incomplete. Check the audio before using it.

Managing Your Session

Finishing a word or phrase
As you type, the Console sends text through the latest whitespace character. It holds any trailing text until you enter whitespace or select Finish input. Punctuation alone doesn't send the remaining text. This avoids splitting words or values such as 3.14 between messages.
Editing text
You can edit text that hasn't been sent yet. If you change text that has already been sent, the Console cancels the current session, clears its audio, and starts a new session with the updated text. Clearing all input cancels the active session.
Finishing an inactive session
After 60 seconds without user or service activity, the Console automatically sends any remaining text and finishes a session that is ready for synthesis. If the connection or synthesis session isn't ready, the Console reports a connection error instead.
Generating audio again
When text is present and no session is active, select Generate audio to synthesize the existing text again. This starts a new session, sends all the text, and finishes input automatically.
Resetting the page
Select Reset to cancel the current connection and clear the text, generated audio, errors, and progress information.
Keeping your audio
Download Audio becomes available when audio has been received and the session is no longer active. Download any audio that you want to keep. The page doesn't provide a saved-session history.

Session Status

StatusMeaning
On standbyNo session is active.
Preparing secure connection...The Console is preparing authentication.
Connecting...The connection is opening or authentication is in progress.
Generating audio in realtimeThe session can send text and receive audio.
Finishing audio...All remaining text has been sent and the Console is finalizing the audio.
Audio completeThe Console has finalized the audio it received. If the session didn't finish normally, this audio can be incomplete.
Service errorAuthentication, the connection, synthesis, or audio processing failed.

Troubleshooting

IssueWhat to check
The realtime page isn't visible.Check whether the feature is available for your tenancy and selected region.
Languages or speakers don't load.Check the selected compartment, your permission to list voices, and the model and language selections.
The sample rate is invalid.Enter a whole number from 8,000 through 48,000.
Authentication fails.Refresh your Console session and verify your access to the selected compartment.
No audio plays.Select Finish input to send any buffered text. Select Play if autoplay is blocked. If live playback isn't supported, wait until synthesis finishes.
The connection closes before completion.Review the error message and retry using Generate audio after the connection is available. Any audio already received can be incomplete.