Skip to content

Narrator Function

erew123 edited this page Oct 1, 2024 · 2 revisions

Narrator Function

The Narrator function in AllTalk allows for dynamic voice switching between character dialogue and narration. This guide explains how to use this feature effectively.

Text Formatting

Messages should be formatted as follows:

  • Narrator text: Enclosed in asterisks *
  • Character text: Enclosed in quotation marks "

Example of properly formatted text:

*She walked across the room and picked up her cup of coffee* "Hey! I'm so excited to finally meet you. I've heard so many great things about you and I'm eager to pick your brain about computers."

Handling AI-Generated Text

AI systems may deviate from these formatting rules. AllTalk has been designed to handle various irregularities:

  • Any line beginning or ending with an asterisk is recognized as Narrator dialogue.
  • Lines enclosed in double quotes are identified as Character dialogue.
  • For other text, you can choose how AllTalk handles it (as Character or Narrator dialogue).

Types of Text

When the Narrator function is Enabled or Enabled (Silent), the TTS engine identifies three types of text:

  1. Narrated Text: Text enclosed in asterisks *Narrated text*
  2. Character Text: Text enclosed in double quotes "Character text"
  3. Text-Not-Inside: Any text not enclosed in asterisks or double quotes

Narrator Settings

You can control how narrated text is handled:

  • Enabled: Narrated text is spoken using the narrator voice.
  • Enabled (Silent): Narrated text is recognized but not spoken (useful for silent annotations or actions).
  • Disabled: Narrated text is spoken using the character voice. The narrator engine is turned off, and the Text-Not-Inside setting does not apply.

Note: If Enabled or Enabled (silent) is set as the API default, all text will go through the narrator function unless disabled is sent as part of the TTS generation request.

Text-Not-Inside Settings

Customize how text-not-inside is handled:

  • "Character": Treated as character dialogue and spoken.
  • *Narrator*: Treated as narration and spoken.
  • Silent: Recognized but not spoken.

Examples and Variations

Here are some examples to illustrate different settings:

Example 1: Narrator Enabled, Text-Not-Inside as Character

  • *Narrated text* will be spoken as narration.
  • "Character text" will be spoken as character dialogue.
  • Any other text will be spoken as character dialogue.

Example 2: Narrator Disabled

  • *Narrated text* will be spoken using the character voice.
  • "Character text" will be spoken as character dialogue.
  • Any other text will be spoken as character dialogue.

Example 3: Narrator Enabled (Silent), Text-Not-Inside as Silent

  • *Narrated text* will be recognized but not spoken.
  • "Character text" will be spoken as character dialogue.
  • Any other text will be recognized but not spoken.

Silent Options Impact

  • Narrator Enabled (Silent): Allows for silent annotations within your text.
  • Text-Not-Inside as Silent: Enables inclusion of text that is recognized but not spoken, useful for context or instructions.

Combining Settings

  • Full Silence: If Narrator is set to Enabled (Silent) and Text-Not-Inside is set to Silent, only character text in quotes will be spoken.
  • Partial Silence: Configure settings to have only certain parts of the text spoken while others are silent.

Narrator Function Flow

graph TD
    A[Input Text] --> B{Narrator Enabled?}
    B -->|Yes| C{Text Type}
    B -->|No| D[All text spoken as Character]
    
    C -->|Asterisks *...* | E{Narrator Mode}
    C -->|Quotes| F[Spoken as Character]
    C -->|Neither| G{Text-Not-Inside Setting}
    
    E -->|Enabled| H[Spoken as Narrator]
    E -->|Enabled Silent| I[Recognized, Not Spoken]
    
    G -->|Character| J[Spoken as Character]
    G -->|Narrator| K[Spoken as Narrator]
    G -->|Silent| L[Recognized, Not Spoken]

    style A fill:#f9f,stroke:#333,stroke-width:2px
    style B fill:#bbf,stroke:#333,stroke-width:2px
    style C fill:#bbf,stroke:#333,stroke-width:2px
    style D fill:#bfb,stroke:#333,stroke-width:2px
    style E fill:#bbf,stroke:#333,stroke-width:2px
    style F fill:#bfb,stroke:#333,stroke-width:2px
    style G fill:#bbf,stroke:#333,stroke-width:2px
    style H fill:#bfb,stroke:#333,stroke-width:2px
    style I fill:#fbb,stroke:#333,stroke-width:2px
    style J fill:#bfb,stroke:#333,stroke-width:2px
    style K fill:#bfb,stroke:#333,stroke-width:2px
    style L fill:#fbb,stroke:#333,stroke-width:2px
Loading

Explanation of the Flowchart

  1. The process starts with the Input Text.
  2. It first checks if the Narrator function is enabled.
  3. If Narrator is disabled, all text is spoken as Character.
  4. If Narrator is enabled, it checks the type of text:
    • Text in asterisks (*...*) is processed according to the Narrator Mode.
    • Text in quotes ("...") is always spoken as Character.
    • Text neither in asterisks nor quotes is processed according to the Text-Not-Inside setting.
  5. Narrator Mode can be either Enabled (text is spoken) or Enabled Silent (text is recognized but not spoken).
  6. Text-Not-Inside can be set to Character (spoken as character), Narrator (spoken as narrator), or Silent (recognized but not spoken).

Green boxes indicate text that will be spoken, red boxes indicate text that is recognized but not spoken, and blue boxes represent decision points.

Short Story Example

+ *Once upon a time in a small village, there was a young girl named Lily.*
! Lily woke up early every morning.
- "I love exploring the forest near my home."
+ * Lily said. One day, she found a mysterious key lying on the ground.*
- "This key looks old and rusty, but it seems to sparkle in the sunlight,"
! She thought. Lily decided she would keep the key safe until she could discover its purpose.
+ *Curious and excited, she decided to find out what the key opened.*

Explanation

  • Narrated Text (Lines starting with +):

    • These lines are enclosed in asterisks and represent the narration.
    • If Narrator is set to Enabled (Silent), these lines would not be spoken.
  • Character Text (Lines starting with -):

    • These lines are enclosed in double quotes and represent the character's spoken dialogue or thoughts.
  • Text-Not-Inside (Lines starting with !):

    • These lines are not enclosed in asterisks or quotes and will be handled according to the Text-Not-Inside settings.
    • If set to Text-not-inside > Silent, these lines would not be spoken.
Clone this wiki locally