Files
BreakEscape/planning_notes/npc/progress/VOICE_MESSAGES_WORKING_EXAMPLES.md
Z. Cliffe Schreuders f369b41547 feat: Implement voice messages in phone chat minigame
- Added support for voice messages prefixed with "voice:" in Ink files.
- Updated UI rendering to display voice message UI with play button and transcript.
- Implemented automatic conversion for scenario JSON with voice properties.
- Created test examples for pure voice messages and mixed content.
- Fixed issues with NPC registration and message duplication in test scenarios.
- Documented feature details, use cases, and testing procedures.
2025-10-30 02:45:05 +00:00

3.7 KiB

Voice Message Examples - Working Reference

All Examples Now Working

1. IT Team - Pure Voice Message

File: scenarios/ink/voice-message-example.ink

=== start ===
voice: Hi, this is the IT Team. Security breach detected in server room. Changed access code to 4829.
-> END

Compiled: scenarios/compiled/voice-message-example.json (209 bytes)

Display: Voice message UI with:

  • ▶️ Play button
  • 🌊 Audio waveform
  • 📄 Transcript: "Hi, this is the IT Team..."

2. David - Mixed Text + Voice

File: scenarios/ink/mixed-message-example.ink

=== start ===
Hello! This is a test of mixed message types.

+ [Tell me more]
    -> voice_example

=== voice_example ===
voice: This is a voice message. I'm calling to let you know that the security code has been changed to 4829. Please acknowledge receipt.

+ [Got it, thanks!]
    Great! I'll see you soon.
    -> END

+ [What was the code again?]
    voice: The code is 4-8-2-9. I repeat: four, eight, two, nine.
    -> END

Compiled: scenarios/compiled/mixed-message-example.json (720 bytes)

Display:

  1. First message: Regular text bubble
  2. After choice: Voice message UI
  3. Depending on choice: Either text or another voice message

3. Simple Conversion Test - Runtime Conversion

Source: Phone object (old format)

{
  "type": "phone",
  "voice": "Welcome to the Computer Science Department! The CyBOK backup is in the Professor's safe.",
  "sender": "Receptionist"
}

Converted To: Ink JSON with voice: prefix (automatic)

Display: Voice message UI (same as IT Team)


Full Contact List

When you open the phone (player_phone), you should see:

  1. Alice - Security Consultant

    • Type: Interactive chat
    • Story: alice-chat.json
    • Avatar:
  2. Bob - IT Manager

    • Type: Interactive chat
    • Story: generic-npc.json
    • Avatar:
  3. Charlie - Security Guard

    • Type: Interactive chat
    • Story: generic-npc.json
    • Avatar:
  4. Security Team

    • Type: Simple text message
    • Story: simple-message.json
    • Avatar:
  5. IT Team FIXED

    • Type: Voice message
    • Story: voice-message-example.json
    • Avatar:
    • Display: Voice UI with waveform
  6. David - Tech Support FIXED

    • Type: Mixed text + voice
    • Story: mixed-message-example.json
    • Avatar:
    • Display: Text then voice based on choices

Visual Differences

Regular Text Message (Security Team)

┌────────────────────────────────┐
│ Security alert: Unauthorized   │
│ access detected...             │
│                       2:18 PM  │
└────────────────────────────────┘

Voice Message (IT Team, David after choice)

┌────────────────────────────────┐
│  ▶️  ~~~~~~~~~~~~~~~~~~~        │
│                                 │
│  📄 Transcript:                 │
│  Hi, this is the IT Team...    │
│                                 │
│                       2:18 PM  │
└────────────────────────────────┘

Verification Checklist

All 6 NPCs appear in contact list IT Team shows voice message UI David shows mixed text + voice Simple conversion test doesn't create duplicates Voice messages have play button + waveform Transcript displays correctly Timestamp shows on all messages


Status: All Working
Date: 2025-10-30
Test Page: test-phone-chat-minigame.html