Skip to main content

Overview

Typecast AutoTag is a text preprocessing SDK that converts structured data (phone numbers, dates, times, amounts, etc.) into TTS-friendly formats for voice applications.

GitHub Repository

neosapience/typecast-autotag (MIT)

Issues & Discussions

Report bugs, request handlers

Why AutoTag?

When building voice applications, raw text often doesn’t translate well to natural speech:
InputWithout AutoTagWith AutoTag
555-123-4567”five five five dash one two three dash four five six seven""five five five, one two three, four five six seven”
$1,500”dollar-one-comma-five…""one thousand five hundred dollars”
14:30”fourteen-colon-thirty""two thirty PM”
AutoTag automatically detects these patterns and converts them to natural speech, improving the user experience in voice applications.

Language Support

Full support for English text preprocessing with proper number reading, currency formatting, and more.
import { autoTag } from 'typecast-autotag';

autoTag('Call me at 555-123-4567.', { language: 'en' });
// → 'Call me at five five five, one two three, four five six seven.'

autoTag('Total is $1,500.', { language: 'en' });
// → 'Total is one thousand five hundred dollars.'

Installation

Clone the repo and build the dist bundle locally, then link or point your package.json at the local path.
git clone https://github.com/neosapience/typecast-autotag.git
cd typecast-autotag
pnpm install
pnpm build
Then from the project that needs it:
# File-path dependency (recommended while iterating)
pnpm add file:../typecast-autotag

# Or git URL (the consumer is responsible for running build —
# the repo's prepare script does not run microbundle yet)
pnpm add github:neosapience/typecast-autotag

Quick Start

Auto-Tagging

Automatically detect and convert patterns in your text:
import { autoTag } from 'typecast-autotag';

// Phone numbers
autoTag('Call 555-123-4567', { language: 'en' });
// → 'Call five five five, one two three, four five six seven'

// Dates and times
autoTag('Meeting at 2:30 PM on January 15, 2024', { language: 'en' });
// → 'Meeting at two thirty PM on January fifteenth, twenty twenty-four'

// Currency
autoTag('Total: $1,234.56', { language: 'en' });
// → 'Total: one thousand two hundred thirty-four dollars and fifty-six cents'

Manual-Tagging

Use explicit tag syntax for precise control:
import { manualTag } from 'typecast-autotag';

// Name spelling (character by character)
manualTag('Hello, name(John).', { language: 'en' });
// → 'Hello, J O H N.'

Combined Usage

Apply both auto and manual tags together:
import { autoTagWithManual } from 'typecast-autotag';

autoTagWithManual('name(John), call 555-123-4567.', { language: 'en' });
// → 'J O H N, call five five five, one two three, four five six seven.'
Manual tags are processed first, then auto-tags are applied to the remaining text.

Supported Tags

Auto-Tags (Automatically Detected)

TagDescriptionExample
phonePhone numbers555-123-4567
datetimeDate and time2024-01-15T14:30
timeTime2:30 PM
dateDateJanuary 15, 2024
moneyCurrency$1,500
yearYearyear 2024
monthMonthJanuary
dayDaythe 15th
orderOrdinal1st place
pointPoints/scores95 points
ratioRatio/percent50%, 1:2
weightWeight5kg, 100lb
distanceDistance5km, 100m
temperatureTemperature25°C, -5°F
volumeVolume500ml, 2L
dataCapacityData size100GB, 50Mbps

Manual-Only Tags

TagDescriptionSyntaxOutput
nameName (char-by-char)name(John)J O H N
digitsDigit-by-digitdigits(1234)one two three four

AICC Use Case

Perfect for AI Contact Center applications where natural speech is critical:
import { autoTagWithManual } from 'typecast-autotag';

// Customer service script
const customerName = 'John Smith';
const orderNumber = '12345';
const deliveryDate = 'January 15, 2024';
const supportPhone = '1-800-555-1234';

const script = autoTagWithManual(`
  Hello, name(${customerName}).
  Your order number digits(${orderNumber}) will be delivered on ${deliveryDate}.
  For questions, please call ${supportPhone}.
`, { language: 'en' });

// Output:
// "Hello, J O H N S M I T H.
//  Your order number one two three four five will be delivered on January fifteenth, twenty twenty-four.
//  For questions, please call one, eight zero zero, five five five, one two three four."

Integration with Typecast TTS

Combine AutoTag with Typecast TTS API for the best voice experience:
import { autoTagWithManual } from 'typecast-autotag';
import { TypecastClient } from '@neosapience/typecast-js';

const client = new TypecastClient({ apiKey: 'YOUR_API_KEY' });

// Preprocess text with AutoTag
const rawText = 'Your balance is $1,234.56. Call 555-123-4567 for support.';
const processedText = autoTagWithManual(rawText, { language: 'en' });

// Send to Typecast TTS
const audio = await client.textToSpeech({
    text: processedText,
    model: 'ssfm-v30',
    voice_id: 'tc_672c5f5ce59fac2a48faeaee'
});

Platform Support

Development Languages

LanguageVersionInstall path
Node.js≥18GitHub source + pnpm build (ESM / CJS / UMD)
BrowserModernSame bundle, dist/index.mjs
Python≥3.8pip install -e python-binding/ (after C build)
Java≥8mvn install from java-binding/ (after C build)
C/C++AnyPre-built binary from Releases or pnpm c-binding:build-all-multiarch

Server Platforms

PlatformStatus
LinuxSupported (CentOS 6.9+, Amazon Linux 2+, Ubuntu, Debian)
macOSSupported (Intel & Apple Silicon)
WindowsSupported (Windows 10+)

Architectures

ArchitectureStatus
x86_64 (AMD64)Supported
x86 (32-bit)Supported
arm64 (AArch64)Supported
armv7 (32-bit ARM)Supported

Next Steps

Quickstart

Get started with Typecast TTS API

SDK Documentation

Explore our SDK documentation