<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Asad Shehzad</title>
    <description>The latest articles on DEV Community by Asad Shehzad (@secretheart49).</description>
    <link>https://dev.to/secretheart49</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4188176%2Feda4e3ec-909e-4bce-b7d8-5a5ca6d80c91.png</url>
      <title>DEV Community: Asad Shehzad</title>
      <link>https://dev.to/secretheart49</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/secretheart49"/>
    <language>en</language>
    <item>
      <title>Making open-source text to speech sound right: ranked voices, text normalization and one engine for Python and the browser</title>
      <dc:creator>Asad Shehzad</dc:creator>
      <pubDate>Fri, 16 Oct 2026 07:58:38 +0000</pubDate>
      <link>https://dev.to/secretheart49/making-open-source-text-to-speech-sound-right-ranked-voices-text-normalization-and-one-engine-for-3oia</link>
      <guid>https://dev.to/secretheart49/making-open-source-text-to-speech-sound-right-ranked-voices-text-normalization-and-one-engine-for-3oia</guid>
      <description>&lt;p&gt;Open text-to-speech models have become small and fast enough to run anywhere. Piper voices run faster than real time on a laptop CPU. But when we built the &lt;a href="https://loudness.ai/tools/text-to-speech/" rel="noopener noreferrer"&gt;text-to-speech tool on Loudness.ai&lt;/a&gt;, three problems stood between “it runs” and “it sounds right”. &lt;a href="https://github.com/Loudness-ai/loudness-tts" rel="noopener noreferrer"&gt;loudness-tts&lt;/a&gt; is what we built to solve them, and it is free and open source.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Which voice?
&lt;/h2&gt;

&lt;p&gt;Piper has more than 170 voice files, some with hundreds of speakers. Their quality varies a lot, and many are licensed for non-commercial use only. We tested every one: 1,683 voices that a business may use, scored for naturalness (UTMOS22) and clarity (character error rate with Whisper large-v3). The full study, data and a voice explorer are public:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Report: &lt;a href="https://loudness.ai/research/piper-tts-voices-ranked/" rel="noopener noreferrer"&gt;Open Piper TTS Voices Ranked&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Dataset: &lt;a href="https://huggingface.co/datasets/Loudness-ai/piper-voices-ranked" rel="noopener noreferrer"&gt;Loudness-ai/piper-voices-ranked on Hugging Face&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Voice explorer: &lt;a href="https://huggingface.co/spaces/Loudness-ai/piper-voice-explorer" rel="noopener noreferrer"&gt;listen to and compare every voice&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa16p0xai50an3ssmzmnv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa16p0xai50an3ssmzmnv.png" alt="Chart: the overall score of every speaker in each Piper model with ten or more speakers, with the best and the median voice of each model. Scores within one model range from about 24 to 96." width="800" height="691"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The speaker you pick matters more than the model.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In loudness-tts, &lt;code&gt;voice="auto"&lt;/code&gt; picks the best voice with a clear licence for your language, and every voice tells you the credit line its licence asks for.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Reading text the way a person does
&lt;/h2&gt;

&lt;p&gt;Piper does no text normalization. “$5.50” becomes “dollar five point five zero”, “4/5/2026” becomes “four slash five slash two thousand twenty-six”, and “Dr. Smith” ends a sentence after “Dr.”. loudness-tts runs a rule layer first: money, dates, times, units, phone numbers, ranges, fractions, abbreviations and Roman numerals become words, in English and Spanish.&lt;/p&gt;

&lt;p&gt;Every spoken word keeps a pointer to the text it came from, so subtitles and word highlighting stay aligned with what was written. We measured the effect on our own test suite and on an independent one: &lt;a href="https://loudness.ai/research/piper-tts-text-normalization/" rel="noopener noreferrer"&gt;Teaching Piper TTS to Read&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fso6dqn1wovk5y7wqfrwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fso6dqn1wovk5y7wqfrwy.png" alt="Diagram: written text and how it is read aloud, word by word. “Dr.” becomes “Doctor”, “$5.50” becomes “5 dollars and 50 cents” and “4/5/2026.” becomes “April 5th, 2026”, each with the time it is spoken." width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Every spoken word points back to what was written.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Output you can publish
&lt;/h2&gt;

&lt;p&gt;Every result is loudness-normalized to −16 LUFS with true peak at or below −1.5 dBTP, which suits podcasts and video. Word timings come from the model’s own phoneme durations, so SRT and VTT subtitles are exact. Joins between speech and silence get short fades, so there are no clicks.&lt;/p&gt;
&lt;h2&gt;
  
  
  One engine, two languages
&lt;/h2&gt;

&lt;p&gt;The Python edition is a normal package (&lt;code&gt;pip install loudness-tts&lt;/code&gt;). The JavaScript edition had to give the same speech without Python, in Node, Bun, Deno and the browser. We compiled espeak-ng from the commit Piper uses to WebAssembly, ran the voices on onnxruntime-web, and ported the text rules line by line, with a small helper that gives JavaScript regular expressions Python’s Unicode behaviour. Parity tests compare both editions on 8,609 text cases and all 78 voice models.&lt;/p&gt;
&lt;h2&gt;
  
  
  Use it
&lt;/h2&gt;

&lt;p&gt;From the command line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;loudness-tts
loudness-tts &lt;span class="s2"&gt;"Dr. Smith paid &lt;/span&gt;&lt;span class="nv"&gt;$5&lt;/span&gt;&lt;span class="s2"&gt;.50 on 4/5/2026."&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; speech.wav &lt;span class="nt"&gt;--srt&lt;/span&gt; speech.srt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From Python:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;loudness_tts&lt;/span&gt;
&lt;span class="n"&gt;loudness_tts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;speak&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello! The meeting starts at 9:30 AM.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;hello.wav&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For chat apps there is an OpenAI-compatible server (&lt;code&gt;loudness-tts serve&lt;/code&gt;, or the Docker image), with step-by-step guides for &lt;a href="https://loudness.ai/developers/guides/open-webui-text-to-speech/" rel="noopener noreferrer"&gt;Open WebUI&lt;/a&gt;, &lt;a href="https://loudness.ai/developers/guides/librechat-text-to-speech/" rel="noopener noreferrer"&gt;LibreChat&lt;/a&gt; and &lt;a href="https://loudness.ai/developers/guides/anythingllm-text-to-speech/" rel="noopener noreferrer"&gt;AnythingLLM&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Try it without installing anything: &lt;a href="https://huggingface.co/spaces/Loudness-ai/text-to-speech-browser" rel="noopener noreferrer"&gt;Free Text to Speech in Your Browser&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Code: &lt;a href="https://github.com/Loudness-ai/loudness-tts" rel="noopener noreferrer"&gt;github.com/Loudness-ai/loudness-tts&lt;/a&gt; (GPL-3.0)&lt;/li&gt;
&lt;li&gt;Package: &lt;a href="https://pypi.org/project/loudness-tts/" rel="noopener noreferrer"&gt;loudness-tts on PyPI&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation and installation guide: &lt;a href="https://loudness.ai/developers/loudness-tts/" rel="noopener noreferrer"&gt;loudness.ai/developers/loudness-tts&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What’s next: reading rules for more languages, and npm. Issues and pull requests are welcome.&lt;/p&gt;

</description>
      <category>tts</category>
      <category>python</category>
      <category>opensource</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
