Custom Voice Creation with Natural Language: Engineering Prompt-Driven TTS Voices

    This article examines how text-to-speech voice selection is shifting from picking one of a handful of preset voices to describing a voice in natural language and generating or retrieving it. It breaks the problem into orthogonal voice dimensions, outlines a four-layer pipeline (intent parsing, voice generation/retrieval, synthesis, governance) with a structured JSON intermediate representation and fallback preset, and covers prompt engineering, bounded controllable generation and voice mixing, a low-latency cache-friendly architecture, subjective and objective evaluation metrics, and the security and compliance requirements that must be designed in from the start. The takeaway: the real work lies in the structured schema, bounded parameters, decoupling of generation from synthesis, and the evaluation and compliance loop.

    From Preset Picking to Prompted Voices

    Building a voice interaction product used to leave developers with exactly one option for voice selection: pick whichever of the platform’s dozen or so presets felt “least wrong.” Marketing copy reads awkwardly, navigation prompts lack warmth, and children’s education scenarios end up with a voice that sounds too adult. These problems are usually not about synthesis quality — they are about how narrow the option space is. Re-recording a full voice library with a real voice actor takes months and costs far more than a small team can absorb.

    A new direction recently showed up in code strings from a mobile OS assistant component: the voice selection menu contains a “create voice” entry, the input field prompts the user to “describe how you want the voice to sound,” and a “surprise me” button generates a random option. The feature is not enabled yet, but the technical paradigm it points to is clear: turning voice selection from an enumerated choice into natural language retrieval and generation. Setting aside the specific product, this article discusses the general technical problems and engineering practices behind that paradigm.

    1. Problem Framing: The Voice Space Explodes in Dimensionality

    In traditional TTS, a voice is a discrete ID — effectively an index into a finite library. The way people describe a voice, however, is inherently high-dimensional and continuous. It can be decomposed into at least five orthogonal groups:

    • Physiological attributes: gender tendency, perceived age, pitch, brightness or darkness of timbre, breathy-to-voiced ratio;
    • Speaking style: speaking rate, pause density, intonation range, stress habits;
    • Region and language: language, accent, dialect, code-switching habits;
    • Emotional state: cheerful, calm, serious, sad, surprised, plus emotional intensity;
    • Scenario fit: in-car navigation, audiobook narration, customer service responses, children’s stories.

    Freely combined, these five groups produce a theoretical space far larger than any preset library. That is the real root cause of monotonous preset voices: not too few entries, but dimensions flattened into a single ID.

    2. Core Pipeline: From Natural Language Description to Playable Audio

    A practical implementation usually has four layers:

    1. Intent parsing layer: parse free text into a structured voice description (schema);
    2. Voice generation/retrieval layer: generate a new voice representation from the text description, or interpolate within an existing voice space (i.e., “voice mixing”);
    3. Synthesis layer: synthesize speech with the target voice representation, with streaming output;
    4. Governance layer: safety review, watermarking, caching, monitoring, and fallback.

    The structured intermediate representation is the key decoupling point in the whole chain. Constraining model output to JSON avoids ambiguity for downstream parsers:

    1. {
    2. "gender": "female",
    3. "age_band": "young_adult",
    4. "pitch": -2,
    5. "speaking_rate": 0.9,
    6. "accent": "regional_soft",
    7. "emotion": "cheerful",
    8. "emotion_intensity": 0.6,
    9. "timbre_hint": "warm, low, slightly breathy",
    10. "language": "zh-CN",
    11. "fallback_preset_id": "preset_07"
    12. }

    fallback_preset_id matters a great deal: when generation fails or review rejects the result, the system must fall back to the semantically closest preset voice so the business is never interrupted.

    Caller-side pseudocode — note that every network call needs a timeout and a fallback path:

    1. def create_voice(user_prompt: str) -> VoiceHandle:
    2. desc = parse_voice_description(user_prompt) # natural language -> structured
    3. desc = safety_filter(desc) # compliance and abuse blocking
    4. try:
    5. emb = synthesize_voice_embedding(desc) # generate the voice representation
    6. return VoiceHandle(emb, quality=grade(emb))
    7. except (TimeoutError, GenerationError):
    8. return VoiceHandle.from_preset(desc["fallback_preset_id"])

    3. Prompt Engineering: Making “Describe a Voice” Controllable

    When a user types something like “warm, low, Scottish accent, slow, cheerful but not over the top,” engineering has to handle three kinds of noise: vague adjectives, mutually conflicting requirements, and missing required fields. Practical recommendations:

    • Templated guidance: put clickable attribute tags next to the input box (pitch, rate, emotion, accent) to converge open input into “tags plus free-form additions”;
    • Conflict resolution rules: define priorities for conflicts — for example, speaking rate outranks emotional intensity, and language/accent cannot be overridden by emotion;
    • Default filling: fill missing fields with scenario defaults rather than leaving them empty and destabilizing generation;
    • Random exploration entry: the “surprise me” button is essentially random sampling inside the structured space; it helps users with no idea what they want and can also serve as a source of cold-start material;
    • Reproducibility: persist the seed and the full desc so the same description reproduces the same voice, which makes debugging and regression testing tractable.

    4. Controllable Generation and Voice Mixing

    With text as the only condition, voice controllability is typically achieved along two paths: generating the voice representation directly from the text description, or parametrically rewriting an existing voice — adjusting pitch, accent, rate, and similar features to produce a “mix.” Combining the two is the better engineering choice: generate a base representation from the description, then use mixing for fine-grained adjustment. Controllability and stability both improve.

    Controllability must be bounded. Clamp pitch, speaking_rate, and emotion_intensity to upper and lower limits so the system never produces extreme voices that sound distorted or unintelligible:

    1. CLAMP = {"pitch": (-4, 4), "speaking_rate": (0.7, 1.3), "emotion_intensity": (0.0, 1.0)}
    2. desc = {k: min(max(v, CLAMP[k][0]), CLAMP[k][1]) if k in CLAMP else v
    3. for k, v in desc.items()}

    Multilingual and dialect support is the biggest payoff of this paradigm: one description template plus a language parameter covers multiple languages and dialects, with no need to record a separate library per language. The caveat is that the semantics of “accent” drift across languages, so value enumerations and copy must be maintained independently per language.

    5. Architecture: Low Latency, Cacheable, Degradable

    Voice customization is a classic “generate rarely, reuse constantly” workload, so the architecture should separate reads from writes:

    • Decouple generation from synthesis: persist the voice representation after generating it once (object storage plus metadata in a database); later synthesis is only lightweight inference;
    • Multi-level caching: cache voice representations keyed on hash(desc + seed + language) and reuse on a hit;
    • Streaming synthesis: prioritize time to first packet, split by sentence into a pipeline, and play while synthesizing;
    • Async and queues: route batch generation through a message queue to smooth peaks and keep them from crowding the online path;
    • Observability: track generation success rate, fallback rate, time to first packet, and cache hit rate with logging and alerting;
    • Elastic scaling: let the container platform scale automatically on queue depth and latency metrics.

    If you build on general-purpose cloud TTS capabilities (for example, the speech synthesis product category offered by Baidu AI Cloud), connect the “generation side” and the “synthesis side” separately and keep the option to switch, avoiding tight coupling to a single implementation.

    6. Evaluation: Subjective and Objective Together

    Voice quality is ultimately judged by people, but engineering needs regression-friendly metrics:

    • Intelligibility: character error rate / word error rate, to confirm extreme parameter values do not sacrifice clarity;
    • Voice consistency: similarity score between the generated voice and the target description, plus consistency across sentences;
    • Naturalness: subjective MOS scores, backed by small-scale blind A/B tests;
    • Stability: reproducibility at the same seed, and timbre drift across long text;
    • Business metrics: completion rate, number of interaction turns, and the share of users who manually switch voices (a decline means the default voice fits taste better).

    Track “number of user readjustments” as a core experience metric: if users need three or more changes on average before they are satisfied, the parsing layer or the guidance layer needs work.

    7. Security and Compliance: A Prerequisite, Not an Afterthought

    Natural language voice generation carries inherent abuse risk, so these controls belong in the design phase, not the pre-launch checklist:

    • Identity constraints: prohibit generating an identifiable real person’s voice from a text description, and block “sounds like [person]” prompts;
    • Content review: review both the input description and the generated result, and retain audit logs;
    • Explicit labeling: add an imperceptible watermark and metadata marking to synthesized audio so it is identifiable as synthetic speech;
    • Authorization records: rewriting a real person’s voice library requires explicit authorization records and a revocation mechanism;
    • Rate limits and quotas: cap generation frequency per user to prevent resource abuse.

    Conclusion

    “Create a voice with one sentence” looks like a change at the interaction layer; in substance it upgrades voice management from discrete selection to continuous, controllable generation. For developers, the real effort is not calling a generation API once — it is designing the structured intermediate representation, the bounded parameter system, the architectural decoupling of generation from synthesis, and the evaluation and compliance loop. Get those four things solid, and a voice product can escape the trap of monotonous presets: voice becomes a programmable, iterable, governable product asset rather than a hard-coded configuration list.