name: ac878-news-pipeline description: Generate Mandarin TTS news bulletins for AC878 radio. Use when producing morning news (7am, 4 segments to Morning News 1-4) or afternoon news (3:15pm, 4 segments to Live 1-4). Covers news aggregation, Mandarin script writing, TTS quality gate, audio production, and OneDrive delivery.
AC878 News Pipeline
Quick Start
# Morning pipeline
bash scripts/morning_news_pipeline.sh
# Afternoon pipeline
bash scripts/afternoon_news_pipeline.sh
Workspace: /Users/jackycheung/.openclaw/workspace/
Full Pipeline Steps
1. Aggregate News
python3 scripts/news_aggregator.py
Pulls from RSS (ABC, Guardian, SBS, SCMP) + Tavily search. Output: news/raw/ (JSON + markdown brief).
2. Write 4 Mandarin TTS Scripts
Each script: 6000-7500 CJK characters (count unicode 4e00-9fff only).
Content split:
- Script 1: Traffic/History/Markets/Breaking/Finance
- Script 2: Australian News + Weather (Sydney, Melbourne, Brisbane, Perth, Adelaide, Canberra)
- Script 3: China/HK News
- Script 4: International News
MANDATORY rules — no exceptions:
- NO punctuation (no 。,、:;!?)
- NO symbols (no #, *, [], etc)
- NO dates or days of week
- NO English words
- NO source attribution (no ABC, Reuters, etc)
- NO HK national security law stories
- Politically neutral tone
- These are for SPEAKING — edge_tts handles pauses naturally
Morning scripts → scripts/morning_scripts/script_1.txt through script_4.txt
Afternoon scripts → news/afternoon-file-1.txt through afternoon-file-4.txt
Afternoon scripts MUST contain FRESH news, not a copy of morning.
3. Quality Gate (BEFORE TTS)
python3 scripts/tts_quality_gate.py script1.txt script2.txt script3.txt script4.txt
Validates: char count, no punctuation, no English. Fix failures before proceeding.
4. Produce Audio
Pipeline scripts handle TTS + conversion automatically:
- Voice:
zh-CN-YunyangNeural(edge_tts) - Output: 128kbps, 44.1kHz, stereo MP3
- Target duration: 20-25 minutes each
5. Verify Delivery
BASE="/Users/jackycheung/Library/CloudStorage/OneDrive-AC878MediaGroup/Zara Playlist"
# Morning: check Morning News 1-4 folders
# Afternoon: check Live 1-4 folders
Each file must be >5MB, 18-27 minutes, stereo 44.1kHz.
6. Audio Quality Gate (AFTER TTS)
python3 scripts/tts_quality_gate.py --check-audio "$BASE/Morning News 1/"
Successful Pattern Reference
See bank/areas/experiential-learning.md for canonical successful run details.
Common Failures
- Scripts too short (<6000 chars) → rewrite with more detail
- Punctuation leaking in → rewrite, run quality gate again
- English words in scripts → translate ALL names to Chinese
- Pipeline timeout → check edge_tts connectivity