← Back to Docs
  • index.html
  • Clayground
  • Clayground.Character3D
  • Speech
  • Clayground 2026.2
  • Speech QML Type

    Voice output with approximate lip-sync for characters. More...

    Import Statement: import Clayground.Character3D

    Detailed Description

    Speech lets a character say things while its mouth moves along. Two kinds of input are supported:

    The mouth shape is published through the continuous properties mouthOpen, mouthWide and mouthRound which Head consumes via its speechSource property. Character wires this up automatically - typically you only call say():

    import Clayground.Character3D
    
    Character {
        id: hero
        Component.onCompleted: hero.say("Hello! Welcome to Clayground.")
    }
    
    // Or play a recorded line:
    // hero.say("dialog/intro.wav")
    
    // Advanced configuration via the speech engine:
    // hero.speech.rate = 0.2
    // hero.speech.volume = 0.8

    Strings ending in a known audio extension (wav/mp3/ogg/m4a/flac) are treated as file paths or URLs, anything else as text to speak.

    See also Character and Head.