Web Speech API in Angular: Why Teams Switch to Cloud TTS

By TextHear editorial team · Updated 2026-11-19

Browser-based speech synthesis often lacks consistency, causing voice quality and language support to vary between Angular applications. Teams building accessibility tools need predictable, auditable audio generation to ensure reliable user experiences across all devices.

This page explains how to replace unreliable browser implementations with a stable cloud API. We provide step-by-step guidance for Angular integration, covering voice selection for dyslexia support, language localization, and handling long documents with precise control over output format and speed.

Web Speech API in Angular: Why Teams Switch to Cloud TTS

Frequently asked questions

Is the Web Speech API reliable for large accessibility teams?

Browser implementations vary significantly across devices and operating systems, leading to inconsistent audio quality and behavior. TextHear provides a predictable, auditable cloud API that replaces these unreliable native implementations. This ensures consistent delivery for large accessibility teams requiring uniform user experiences regardless of the end-user's specific browser or OS environment.

How does cloud TTS differ from browser speech synthesis?

Cloud TTS uses licensed recordings from LibriVox, generating high-quality audio files via a standard API. Unlike browser synthesis, which depends on local system voices, our API returns consistent MP3, WAV, Opus, FLAC, or PCM files. This eliminates browser-specific quirks and ensures the same voice and quality for every user, regardless of their device.

Can I use Angular with this cloud TTS API?

Yes. The API follows the same request shape as the OpenAI speech endpoint. You can use the official OpenAI SDKs by changing the base_url to https://api.playstar75.cc/v1. Alternatively, send a standard POST request to /v1/audio/speech with your JSON body containing the model, input text, voice, and other parameters directly from your Angular service.

What languages are supported for text-to-speech?

We support 23 languages: Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, and Turkish. Any voice can speak any of these languages. If the language is not set, it is guessed from the script, defaulting to English for Latin text.

Does the API support slow speech for dyslexia users?

Yes. The API accepts a speed parameter ranging from 0.25 to 4.0. This allows you to generate audio at slower rates for better readability. For dyslexia users, setting a lower speed value ensures the audio is clear and easy to follow. You can adjust this parameter per request to match specific accessibility needs.

How much does it cost to generate audio for long documents?

Pricing is $10 per 1 million characters, or $0.01 per 1,000 characters. Spaces and punctuation count as characters. For long documents, split the text into parts of up to 4,096 characters, generate audio for each, and join the files. Failed requests are free, with the charge returned in full automatically.

Is there a trial available for testing the API?

Yes, a free trial provides $0.50 of credit, valid for 7 days, when you sign in with Google. This covers approximately 50,000 characters. Accounts created with email and password start without trial credit. You can top up later using USDT on the TRON network (TRC-20) with a minimum of $5.

Can I customize the voice speed in my Angular app?

Yes. Include the speed field in your JSON request body, with values between 0.25 and 4.0. This allows precise control over the playback rate. For example, set speed to 0.5 for slower, clearer audio suitable for learning support. The API processes these requests sequentially, so under load, generation may take slightly longer.

What happens if a request fails during generation?

If synthesis fails, the charge is returned in full. You are not billed for failed requests. This ensures you only pay for successful audio generation. You can retry the request or adjust parameters like text length or voice selection. The API returns a clear status, allowing your application to handle errors gracefully.

Do I need a specific browser version for the API?

No. The API is cloud-based and returns standard audio files (MP3, WAV, etc.). Any modern browser that can play these formats can use the generated audio. This removes dependency on specific browser versions or operating systems, ensuring consistent playback for all users, including those on older devices or assistive technologies.

How are audio files delivered to the frontend?

The API returns the audio file directly in the response body. You can save this file or play it directly in an HTML5 audio element. For long texts, split the input into chunks, generate each chunk, and join the resulting audio files. This approach ensures reliable delivery without relying on browser-native synthesis capabilities.

Can I use the API for commercial accessibility products?

Yes. The API is designed for high-volume use by teams building accessibility solutions. Input text is used only to produce audio and is not used for training. Generated audio is returned in the response and not stored. You can integrate this into commercial products without additional licensing fees beyond the per-character usage cost.

Is there a limit to the number of requests per minute?

Yes, the rate limit is 60 requests per minute per key. Before the first top-up, the limit is 10 requests per minute. If you exceed the limit, requests may be queued or rejected. For large teams, consider using multiple keys or managing request pacing to ensure consistent performance during peak usage periods.

Does the API store the text I send for training?

No. Input text is used only to produce the audio and is not used for training. Generated audio is returned in the response and not stored. Request metadata (time, characters, status) is kept for billing purposes only. This ensures your content remains private and is not repurposed for model improvement.

First request

curl

curl https://api.playstar75.cc/v1/audio/speech \
  -H "Authorization: Bearer $TTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"tts-1","voice":"aria","input":"Hello from the API.","response_format":"mp3"}' \
  --output hello.mp3

The Challenge with Browser Speech Synthesis

Sound wave illustration for: The Challenge with Browser Speech Synthesis

Browser-based speech synthesis in Angular applications often suffers from inconsistent voice quality depending on the user's operating system. While convenient for quick prototypes, the underlying engine varies significantly between Chrome, Firefox, and Safari, leading to unpredictable audio output that can hinder accessibility compliance.

Developers cannot guarantee which voice will be selected, as browsers prioritize their own system voices over specified names. This variability makes it difficult to maintain a consistent user experience across different devices and browser versions.

Inconsistent voice quality across browsers

Inconsistent voice quality across browsers

The audio quality and naturalness of synthesized speech depend entirely on the browser’s built-in engine. One browser might produce clear, human-like speech, while another uses a robotic or disjointed voice for the same text.

This inconsistency is particularly problematic for accessibility teams who need reliable, auditable audio generation. Users with dyslexia or visual impairments rely on consistent audio cues, which browser APIs cannot consistently guarantee.

  • Variable voice quality across Chrome, Firefox, and Safari
  • Operating system dependent audio engines
  • Unpredictable naturalness for end-users

No guarantee of voice selection

When you request a specific voice name via the Web Speech API, the browser may ignore it if that voice is not installed locally. This leads to silent failures or unexpected voice substitutions without explicit error codes.

For Angular applications requiring specific voice characteristics (e.g., calm narration for instructional content), this lack of control means you cannot enforce a consistent auditory brand or accessibility standard.

  • Browser ignores voice name requests if not locally available
  • No fallback mechanism defined in the standard
  • Difficulty enforcing specific voice traits

Limited language support in older browsers

Older browser versions often lack support for newer languages or updated voice models. This creates fragmentation where users on legacy systems experience poor or non-existent speech synthesis.

Unlike cloud TTS which supports 23 languages explicitly, browser support is tied to OS updates and browser versions, making it harder to ensure universal accessibility for diverse user bases.

  • Dependent on OS and browser version updates
  • Limited support for niche languages
  • Fragmented user experience across legacy devices

Why Cloud TTS is Better for Accessibility

Sound wave illustration for: Why Cloud TTS is Better for Accessibility

Browser-based speech synthesis varies significantly across devices and operating systems, leading to inconsistent user experiences. Cloud TTS delivers uniform audio quality regardless of the client’s environment, ensuring reliable accessibility compliance for all users.

This consistency is critical for learning support teams who need predictable output for standardized assessments and reading materials.

Consistent audio output everywhere

Cloud TTS decouples audio generation from the browser’s native engine. Your Angular application receives standardized audio files, eliminating discrepancies between Chrome on Windows, Safari on macOS, or older mobile browsers.

This uniformity ensures that accessibility features behave identically for every user, reducing support tickets related to audio rendering issues.

  • Uniform voice quality across all platforms
  • No dependency on OS-specific speech engines
  • Consistent behavior for assistive technologies

Precise control over speed and format

The API allows explicit control over playback speed (0.25–4.0) and output format (mp3, wav, opus, flac, pcm). Teams can optimize audio for specific accessibility needs, such as slower narration for dyslexic readers or compressed formats for bandwidth efficiency.

Unlike browser APIs, you define the exact technical specifications, ensuring compatibility with your existing UI libraries and player components.

  • Adjustable speed from 0.25x to 4.0x
  • Multiple audio formats for optimization
  • Direct integration with standard HTML5 audio players

Predictable performance for long texts

Cloud TTS processes text sequentially with predictable timing, roughly real-time for long documents. This stability allows teams to estimate generation times accurately, improving the user experience for large-scale content delivery.

Failed requests are refunded automatically, ensuring that billing aligns strictly with successful audio generation, providing financial predictability alongside technical reliability.

  • Sequential processing for consistent timing
  • Automatic refund for failed requests
  • Reliable handling of high-volume text

Angular Integration Overview

Sound wave illustration for: Angular Integration Overview

Sending text to the TextHear API is a straightforward HTTP POST to the speech endpoint. You provide the text, voice, and format in a JSON body, then receive the generated audio file. This method works reliably regardless of the browser's native speech engine capabilities.

Simple HTTP POST requests

Use the official OpenAI SDK or a standard fetch call. Configure the base URL to our API endpoint. Pass your API key in the authorization header. The request structure mirrors standard TTS APIs, making migration from other providers simple.

  • POST /v1/audio/speech
  • JSON body with text and parameters
  • Bearer token authentication

JSON response with audio URL

The API returns the audio file directly in the response. You can stream the blob or save it to a temporary URL. This allows immediate playback in your Angular components without complex file handling logic.

Easy integration with existing UI libraries

Integrate the audio response with standard Angular media players. Bind the audio source to your UI components. Ensure consistent playback controls across your application. This approach works seamlessly with existing accessibility libraries and custom audio controls.

Voice Selection for Dyslexia Support

Sound wave illustration for: Voice Selection for Dyslexia Support

For accessibility teams, clarity is paramount. Our voices are engineered to reduce auditory fatigue during extended listening sessions, which is critical for users with dyslexia or attention deficits.

We provide distinct vocal profiles to match different content types, ensuring the audio remains engaging without becoming monotonous over long documents.

Clear, slow-paced narration voices

Aria offers a warm, clear narrator style ideal for books and articles. Luna provides a soft, storytelling tone that helps maintain focus for complex texts.

Sage delivers a calm, instructional voice perfect for educational materials or technical documentation, reducing cognitive load for the listener.

  • Aria: warm, clear narrator
  • Luna: soft, storytelling

Neutral and friendly tone options

Atlas provides a neutral, news-style delivery for factual content, while Milo offers a friendly, conversational tone for interactive guides.

Orion adds depth for documentary-style content, and Felix brings energy to promotional or brief announcements.

  • Atlas: neutral, news
  • Milo: friendly, conversational
  • Orion: deep, documentary
  • Felix: energetic, promo

Support for 23 languages including English

All eight voices can speak any of our 23 supported languages, ensuring consistent audio quality regardless of the text's origin. This uniformity helps teams standardize their accessibility tooling across global user bases.

Explicitly setting the language code prevents mispronunciation, especially for non-Latin scripts or mixed-language content.

  • Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, Turkish

Language Support and Localization

Sound wave illustration for: Language Support and Localization

Reliable localization requires explicit language specification. While the API guesses the language from Latin script by default, setting the language ISO code ensures consistent pronunciation for non-English texts. This prevents misinterpretation of ambiguous words across different browsers and environments.

Explicit language code setting

Always define the language parameter in your JSON payload. This overrides automatic detection and guarantees the voice renders the text in the correct dialect. It is essential for teams managing multilingual content where default assumptions might fail.

  • Set language to ISO codes like en, fr, or de.
  • Overrides default script detection for precise control.
  • Ensures consistent output across all Angular builds.

Automatic script detection

If the language field is omitted, the system infers the language from the character set. Latin script defaults to English, while Cyrillic or Han characters trigger appropriate models. This simplifies integration for single-language applications.

Support for non-Latin scripts

The API supports 23 languages, including non-Latin scripts such as Arabic, Chinese, Japanese, Korean, Russian, and Hebrew. Each voice can pronounce any supported language, ensuring uniform audio quality regardless of the source text's script. Unsupported languages like Vietnamese or Thai are clearly excluded.

  • Supports Arabic, Chinese, Japanese, Korean, Russian, and Hebrew.
  • All 8 voices handle all 23 languages.
  • Excludes Vietnamese, Indonesian, Thai, and others.
Language Support and Localization

Handling Long Documents

Sound wave illustration for: Handling Long Documents

When generating audio for lengthy documents, the API limits each request to 4,096 characters. For larger texts, you must split the input into parts of up to 4,096 characters and join the audio files.

The client-side logic concatenates the resulting audio files into a single file. This ensures a continuous listening experience without manual intervention, maintaining consistent pacing across the entire document.

Splitting text into 4096 character chunks

Each API call accepts a maximum of 4,096 characters, including spaces and punctuation. Your application should parse the source text into segments that respect this limit before sending POST requests to the speech endpoint.

  • Count characters including spaces and punctuation
  • Segment text to stay under 4,096 chars
  • Maintain sentence boundaries where possible

Seamless audio file joining

Once the API returns audio files for each chunk, your client code merges them. The resulting file plays as a single, coherent recording, preserving the narrative flow for the end user.

Efficient processing for large texts

Requests are processed sequentially, so under load a request may wait in a queue. For long texts, generation speed is roughly real-time (about 25 characters of text per second of generation).

  • Process chunks sequentially to maintain order
  • Expect real-time generation speed (~25 chars/sec)
  • Account for queue delays under heavy load

Pricing for Large Teams

Sound wave illustration for: Pricing for Large Teams

TextHear charges $10 per 1 million characters, or $0.01 per 1,000 characters. Failed requests are free, with the charge returned in full. This model ensures you only pay for successful audio generation, making costs predictable for large-scale accessibility projects.

Pay per character usage

Each character, including spaces and punctuation, counts toward your usage. You can monitor your balance and character consumption directly in your account dashboard.

  • $10 per 1 million characters
  • Failed requests are refunded in full

No monthly minimums

There are no monthly plans, seats, or minimum spend requirements. Your balance does not expire, allowing you to scale usage up or down without penalty. Top-ups are made via USDT (TRC-20) on the TRON network.

  • No monthly minimums
  • No subscriptions or invoices
  • Balance does not expire

Trial credit for testing

Signing in with Google provides a $0.50 trial credit, valid for 7 days. This allows teams to verify voice quality and integration speed before committing to larger volumes. Email-based accounts start without trial credit.

  • $0.50 trial credit for Google sign-ins
  • Valid for 7 days
  • Approximately 50,000 characters

Technical Limits and Reliability

Sound wave illustration for: Technical Limits and Reliability

Understanding API constraints ensures your Angular application remains responsive during high-volume accessibility testing. Knowing the boundaries helps you design robust retry logic and user feedback mechanisms for when synthesis takes longer than expected.

This section covers the specific technical limits of the TextHear API, including request throughput, queuing behavior, and how billing handles unsuccessful synthesis attempts to protect your team’s budget.

Rate limits for API stability

Each API key is limited to 60 requests per minute. New accounts start with a lower limit of 10 requests per minute until the first top-up is processed.

This cap prevents server overload and ensures consistent voice quality. If your Angular service sends too many requests simultaneously, subsequent calls may be delayed.

  • 60 requests per minute per key
  • 10 requests per minute for new accounts
  • No hard cap on total daily usage

Request queue management

Requests are processed sequentially. Under heavy load, synthesis may wait in a queue before starting.

This sequential processing ensures that each audio file is generated with full engine resources, maintaining consistent audio quality across all voices and languages.

You should implement exponential backoff in your Angular services to handle temporary delays gracefully.

Failed request credit refund

If synthesis fails due to a server error, the character count is not deducted from your balance.

The charge is returned in full, ensuring you only pay for successfully generated audio files.

This applies to transient errors; check your API response status codes to distinguish between failures and successful generation.

Getting Started with Angular

Sound wave illustration for: Getting Started with Angular

To begin, create an account at /get-api-key/ to retrieve your unique API key. This key authenticates your requests and tracks usage against your balance.

Add the official OpenAI SDK or use native fetch to handle HTTP requests. Point the base URL to https://api.playstar75.cc/v1 to utilize our TTS endpoints.

Obtain your API key

Sign up via Google or email on the /get-api-key/ page. Your dashboard displays your active key, current balance, and a ready-to-use cURL example for immediate testing.

Install the OpenAI SDK or use fetch

Initialize the client with your key and set the base URL to https://api.playstar75.cc/v1. The request shape matches the OpenAI speech endpoint, allowing you to use standard libraries without custom wrappers.

Make your first speech request

Send a POST request to /v1/audio/speech with your text, selected voice, and desired format. The API returns the audio file directly, which you can then play in your Angular component using standard HTML5 audio elements.

  • Set model to "tts-1" or "tts-1-hd"
  • Define voice from the 8 available presets
  • Specify response_format (e.g., mp3, wav)

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. This prevents misinterpretation and maintains clarity for users with dyslexia or visual impairments.

Avatar of the voice aria
ariafemale
Avatar of the voice nova
novafemale
Avatar of the voice luna
lunafemale
Avatar of the voice sage
sagefemale
Avatar of the voice felix
felixmale
Avatar of the voice milo
milomale
Avatar of the voice atlas
atlasmale
Avatar of the voice orion
orionmale

23 languages

Any voice speaks any of these languages.

Sources and further reading

  1. Wikipedia
  2. Creative Commons Attribution 4.0
  3. MDN: Web Speech API
  4. IETF RFC 7845: Ogg Opus
  5. Python documentation
  6. LibriVox public-domain audiobooks
  7. Tether (USDT)
  8. LibriTTS-R corpus (OpenSLR 141)
  9. curl documentation
  10. ISO 639 language codes
  11. TRON developer hub: TRC-20
  12. openai-python on GitHub

More on this site