Hello Everybody

Its has been a very long time since I started some programming project for my own curiosity.

And now that curiosity has reached a level of desparation.

I want to make a talking program. You know like Text-to-Speech. I searched google, but all I found was theory. I found one library FreeTTS to use with Java but I couldn't get it up running.

So, I searched and found the english phonemes. Now I read somewhere that we can generate sound wave using the phonemes in correct order(word-phoneme dictionary)

What I don't know is how to generate the sound wave?

Also, I am a CS student and have no knowledge of Signal Processing. So, please tell me what to do to make a very simple, basic TTS program using phonemes.

And if this is not the right approach, please tell me the right approach.

Dani AI

Generated

A compact, practical roadmap for (and the thread): turning a phoneme sequence into audible speech really means two things — convert text to phonemes (lexicon + simple prosody), then turn those phonemes into a waveform (synthesis). There are two beginner-friendly synthesis paths: concatenative (stitch recorded units) and algorithmic/formant (generate sound from voiced/unvoiced sources and resonators). and show there are quick hacks, but for a reproducible, local Java solution follow the steps below.

  1. Produce reliable phoneme output: use a pronunciation lexicon (CMUdict or similar) and a small rule set for unknown words and basic intonation.
  2. Pick synthesis approach:
  • Concatenative (diphone/unit selection): record a speaker or use a small diphone set (coverage will be on the order of a few thousand diphones for good coverage). Cut, label, normalize and concatenate segments; apply short crossfades (5–20 ms) at joins to avoid clicks.
  • Formant (algorithmic): synthesize a glottal source (simple pulse train for voiced, noise for unvoiced), then pass it through time-varying bandpass filters for the main formants. This needs less data and is easier to tune as a learning project, though it sounds less natural.

Java implementation notes (practical, low-DSP entry points): choose 16-bit PCM, mono, 16 kHz or 22.05 kHz sample rate. Keep every audio unit in the same AudioFormat, normalize RMS levels, and always crossfade joins. Use javax.sound.sampled for output and file writing. A minimal playback skeleton:

AudioFormat fmt = new AudioFormat(22050f, 16, 1, true, false);
SourceDataLine line = AudioSystem.getSourceDataLine(fmt);
line.open(fmt);
line.start();
// write byte[] pcm = ...; line.write(pcm, 0, pcm.length);
line.drain();
line.close();

Troubleshooting tips and next steps: test incrementally (single vowel -> CV -> whole words), verify byte order and encoding, check for sample-rate mismatches, and debug clicks with tiny fades and zero-cross checks. If the goal is a usable TTS fast, try a mature Java TTS engine first to study phoneme-to-audio mappings, then implement a small formant or diphone engine to learn the signal-processing pieces.

Recommended Answers

All 3 Replies

@OP
I don't know if your looking for this but it looks like it may assist you. Also the fact that you have no knowledge of Signal Processing, shouldn't make you any less effective in accomplishing your task.

I tried that, it doesn't work any more.

You didn't try well enough. I just downloaded the code from that page and ran it and it works perfectly.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.