Skip to content

jmoore2333/Sbaitso-JS

Repository files navigation

Dr. Sbaitso

"HELLO [USER], MY NAME IS DOCTOR SBAITSO."

The 1991 DOS AI therapist, faithfully recreated for the modern web.

Setup Guide · How It Works


Dr. Sbaitso Screenshot

What is This?

In 1991, Creative Labs bundled a peculiar program with their Sound Blaster cards: Dr. Sbaitso (Sound Blaster Acting Intelligent Text-to-Speech Operator). Part tech demo, part ELIZA-style chatbot, it featured:

  • Robotic text-to-speech via formant synthesis
  • "AI" therapist that parodied psychology ("TELL ME MORE ABOUT YOUR STROMBOLI")
  • Easter eggs including meltdowns when you swore at it

This project brings Dr. Sbaitso to your browser with 100% authentic voice synthesis by running the actual SBTALKER.EXE in an emulated DOS environment.

Features

Feature Description
Authentic Voice Real SBTALKER.EXE via JS-DOS emulation—not an approximation
Full Chatbot All original responses, commands, and personality quirks
DOS UI Pixel-perfect VGA colors, fonts, and layout
Easter Eggs SAY PARITY, profanity meltdown, and more
Mobile Support Works on iOS Safari, Android Chrome with tap-to-start
Supported Commands

Chat Commands

Command Description
HELP 3-page help system
QUIT Shows quit menu
GOODBYE Personalized farewell
SAY [text] Speak text literally

Dot Commands

Command Description
.COLOR 0-7 Change background (CGA palette)
.PITCH 0-9 Adjust voice pitch
.SPEED 0-9 Adjust speech speed
.VOLUME 0-9 Set volume

Hidden Commands

  • SAY PARITY — Parity error cascade
  • Type DEBUG during loading — Reveal DOSBox window
  • Tap title during mobile loading — Reveal debug log

Quick Start

Prerequisites

  • Node.js 18+
  • The original Dr. Sbaitso DOS files (see below)

1. Clone the Repository

git clone https://github.com/jmoore2333/Sbaitso-JS.git
cd Sbaitso-JS
npm install

2. Add DOS Binaries

The Creative Labs files are not included due to copyright. You'll need:

File Description
SBTALKER.EXE Text-to-speech engine
BLASTER.DRV Sound Blaster driver

These are easily searchable on Google or archive.org, or you may have them on original Sound Blaster media.

Place them in dos-bundle/creative-labs/:

dos-bundle/
└── creative-labs/
    ├── SBTALKER.EXE  ← Add this
    └── BLASTER.DRV   ← Add this

3. Build the Bundle

npm run bundle

This creates public/dos/sbaitso-v2.jsdos containing everything JS-DOS needs. The build script handles:

  • Creating a properly structured JS-DOS bundle (ZIP with .jsdos/ as first entry)
  • Using store compression (required by JS-DOS v8)
  • Converting line endings to Unix format (CRLF→LF, required by JS-DOS)

Windows Users: If you can't run shell scripts, use the PowerShell version instead:

powershell -ExecutionPolicy Bypass -File .\dos-bundle\build-bundle.ps1

You may need to run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser first if you encounter execution policy errors.

4. Run

npm run dev

Open http://localhost:5173 and hear that iconic robotic voice.

How It Works

┌─────────────────────────────────────────────────────────────┐
│                        Browser                              │
├─────────────────────────────────────────────────────────────┤
│  index.html          src/ui/           src/chatbot/         │
│      │                  │                   │               │
│      ▼                  ▼                   ▼               │
│  Loading Screen → Terminal UI → ELIZA Response Engine       │
│                         │                                   │
│                         ▼                                   │
│                  src/tts/jsdos-tts.js                       │
│                  (keystroke injection)                      │
├─────────────────────────────────────────────────────────────┤
│                    JS-DOS (Emulated DOSBox)                 │
├─────────────────────────────────────────────────────────────┤
│  SPKLOOP.COM          SBTALKER.EXE        BLASTER.DRV      │
│  (keyboard bridge) →  (TTS engine)    →   (SB driver)      │
│                            │                                │
│                            ▼                                │
│                   Sound Blaster Emulation                   │
├─────────────────────────────────────────────────────────────┤
│                     Web Audio API                           │
└─────────────────────────────────────────────────────────────┘

The SPKLOOP Bridge

The key innovation is SPKLOOP.COM, a custom 807-byte DOS program that:

  1. Detects the loaded SBTALKER TSR via INT 2F
  2. Captures keyboard input from JS-DOS
  3. Forwards text to SBTALKER's speech buffer
  4. Triggers synthesis via the driver's function pointer

This bridges the gap between browser keystrokes and authentic DOS speech synthesis.

See dos-bundle/custom/SPKLOOP.ASM for the full annotated source.

Deployment

Cloudflare Workers

cp wrangler.toml.example wrangler.toml
# Edit wrangler.toml with your settings
npm run deploy

Static Hosting

npm run build
# Upload dist/ to any static host

Note: The built bundle contains Creative Labs binaries. Only deploy for personal/educational use.

Project Structure

sbaitso-js/
├── src/
│   ├── main.js              # Entry point, loading screen
│   ├── api/sbaitso.js       # Unified interface
│   ├── chatbot/index.js     # ELIZA-style responses
│   ├── tts/jsdos-tts.js     # JS-DOS integration
│   └── ui/index.js          # Terminal interface
├── dos-bundle/
│   ├── custom/              # Our bridge utilities (tracked)
│   │   ├── SPKLOOP.ASM      # Assembly source
│   │   └── SPKLOOP.COM      # Compiled bridge
│   └── creative-labs/       # Your DOS files (gitignored)
├── public/
│   ├── fonts/               # DOS VGA font
│   └── dos/                 # Built .jsdos bundle (gitignored)
└── docs/
    └── research/            # Behavior documentation

Documentation

Mobile Support

Dr. Sbaitso works on mobile browsers including iOS Safari and Android Chrome. Due to browser autoplay policies, mobile users will see a "Tap to Start" button on the loading screen—this user gesture is required to unlock Web Audio before the emulator can produce sound.

Mobile features:

  • Tap-to-start unlocks audio for authentic SBTALKER voice
  • Slower loading animation (JS-DOS takes longer on mobile)
  • Hidden debug log: tap the title during loading to reveal console output

Known Issues & Roadmap

This is an active project. See TODO.md for the full list.

Current limitations:

  • SAY PARITY easter egg is missing authentic sound effects
  • Some response patterns are still being validated against the original
  • Build script needs enhanced dosbox.conf for full compatibility

Planned improvements:

  • CRT shader option for extra nostalgia
  • 40-column display mode (.WIDTH 40)
  • Offline/PWA support

Contributions welcome! Check docs/research/behavior-manifest.md for behavior specifications.

Acknowledgments

  • Creative Labs for the original Dr. Sbaitso (1991)
  • JS-DOS for DOSBox in the browser
  • Anthropic Claude (Opus, Sonnet) for development assistance and reverse engineering guidance
  • Google Gemini for research assistance
  • The retro computing community for preservation efforts

License

MIT License — see LICENSE

Note: This license applies to the JavaScript code and custom bridge utilities only. The Creative Labs DOS binaries (SBTALKER.EXE, BLASTER.DRV, etc.) remain copyrighted by Creative Labs and are not included in this repository.


"I AM NOT A REAL DOCTOR, BUT I CAN HELP YOU WITH YOUR PROBLEMS."

About

A JS port of Dr. Sbaitso, with a custom hook to the Creative Labs SBTalker TTS running in a JS-DOS hidden canvas for 100% authentic speech - optimized for Cloudflare Workers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors