Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Elevenlabs Elevenlabs python ForcedAlignmentCharacterResponseModel

From Leeroopedia
Attribute Value
Sources src/elevenlabs/types/forced_alignment_character_response_model.py
Domains Forced Alignment, Audio Timing, Transcription
Last Updated 2026-02-15

Overview

Description

The ForcedAlignmentCharacterResponseModel represents a single character with its precise timing information from the ElevenLabs forced aligner. Forced alignment is the process of mapping each character in a transcript to its exact time position in the corresponding audio. This model provides the transcribed character along with its start and end times in seconds, enabling character-level precision for synchronization tasks.

Usage

This model is returned as part of forced alignment results, typically within word-level alignment data (see ForcedAlignmentWordResponseModel). It is used in scenarios requiring fine-grained audio-text synchronization, such as precise subtitle timing, animation lip-sync, or phonetic analysis. Each instance represents exactly one character's temporal position in the audio stream.

Code Reference

Source Location

src/elevenlabs/types/forced_alignment_character_response_model.py

Class Signature

class ForcedAlignmentCharacterResponseModel(UncheckedBaseModel):
    """
    Model representing a single character with its timing information from the aligner.
    """
    ...

Import Statement

from elevenlabs.types import ForcedAlignmentCharacterResponseModel

Base Class

UncheckedBaseModel (from elevenlabs.core.unchecked_base_model)

I/O Contract

Field Type Required Description
text str Yes The character that was transcribed.
start float Yes The start time of the character in seconds.
end float Yes The end time of the character in seconds.

Usage Examples

from elevenlabs import ElevenLabs

client = ElevenLabs(api_key="your_api_key")

# Obtain forced alignment results (from a dubbing or alignment endpoint)
# Each character in the aligned text has precise timing
alignment_result = client.audio_native.get_alignment(
    audio_id="audio_abc123"
)

# Iterate through character-level alignment data
for char_alignment in alignment_result.characters:
    duration = char_alignment.end - char_alignment.start
    print(
        f"Character '{char_alignment.text}': "
        f"{char_alignment.start:.3f}s - {char_alignment.end:.3f}s "
        f"(duration: {duration:.3f}s)"
    )

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment