Skip to content

binbenc/IntelligentTeleprompter

Repository files navigation

Intelligent Teleprompter | 智能提词器

Android Kotlin API License

A smart Android teleprompter app that provides real-time script tracking and highlighting based on simulated speech recognition. Perfect for presentations, broadcasting, and public speaking.


English

📱 Overview

Intelligent Teleprompter is an advanced Android application that automatically follows along with your script as you speak. It features real-time highlighting, auto-scrolling, and robust ASR (Automatic Speech Recognition) matching that can handle both English and Chinese content.

✨ Key Features

  • 🎯 Real-time Highlighting: Highlights current reading position as you speak
  • 🌐 Multi-language Support: Handles both English and Chinese text seamlessly
  • 🤖 ASR Simulation: Built-in speech simulator for testing without microphone
  • 📜 Large Script Support: Efficiently processes scripts with 100,000+ words
  • 🎨 Smooth Auto-scrolling: Keeps highlighted content always visible
  • 🔇 Noise Tolerance: Robust matching algorithm handles background noise and speech variations
  • High Performance: Optimized for smooth real-time operation

🚀 Quick Start

Prerequisites

  • Android Studio Arctic Fox or later
  • Android SDK API 24+ (Android 7.0)
  • Kotlin 1.8+

Installation

# Clone the repository
git clone https://github.com/yourusername/IntelligentTeleprompter.git
cd IntelligentTeleprompter

# Build and install
./gradlew installDebug

Usage

  1. Open the app and place your script in app/src/main/assets/script.txt
  2. The app automatically parses and displays your script
  3. Start speaking and watch as the app highlights your current position
  4. Use the built-in ASR simulator for testing without actual speech

🏗️ Architecture

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   MainActivity  │◄───┤  AsrSimulator     │◄───┤  Real Speech    │
└─────────────────┘    └──────────────────┘    └─────────────────┘
         │                       │
         ▼                       ▼
┌─────────────────┐    ┌──────────────────┐
│ TeleprompterAd- │    │   ScriptEngine   │
│ apter (UI)      │◄───┤  (Matching Alg)  │
└─────────────────┘    └──────────────────┘
         │
         ▼
┌─────────────────┐
│  RecyclerView  │
│  (Display)      │
└─────────────────┘

🧪 Testing

# Run unit tests
./gradlew test

# Run instrumented tests
./gradlew connectedAndroidTest

# Run lint checks
./gradlew lint

📈 Performance

  • Script Parsing: O(n) complexity with coroutines for background processing
  • ASR Matching: O(1) sliding window algorithm with configurable search window
  • UI Updates: Efficient RecyclerView with partial updates and Spannable optimization
  • Memory: Optimized for large scripts with pre-allocated collections

🛠️ Configuration

Customize the app behavior by modifying these parameters:

// ASR matching window size
val windowSize = 50  // Search forward 50 tokens

// Auto-scroll settings
smoothScroller.calculateTimeForScrolling(dx: Int): Int = 150  // Scroll duration

// Highlight colors
val highlightColor = Color.GREEN
val normalTextColor = Color.GRAY

中文 (Chinese)

📱 项目概述

智能提词器是一款先进的Android应用程序,可以在您演讲时自动跟随脚本进度。它具备实时高亮、自动滚动和强大的ASR(自动语音识别)匹配功能,能够完美处理中英文混合内容。

✨ 核心特性

  • 🎯 实时高亮: 说话时自动高亮当前阅读位置
  • 🌐 多语言支持: 无缝处理中英文混合文本
  • 🤖 ASR模拟: 内置语音模拟器,无需麦克风即可测试
  • 📜 大脚本支持: 高效处理10万+词汇的大型脚本
  • 🎨 平滑自动滚动: 始终保持高亮内容可见
  • 🔇 噪音容忍: 强大的匹配算法,处理背景噪音和语音变化
  • 高性能: 为流畅的实时操作而优化

🚀 快速开始

环境要求

  • Android Studio Arctic Fox 或更高版本
  • Android SDK API 24+ (Android 7.0)
  • Kotlin 1.8+

安装步骤

# 克隆仓库
git clone https://github.com/yourusername/IntelligentTeleprompter.git
cd IntelligentTeleprompter

# 构建并安装
./gradlew installDebug

使用方法

  1. 打开应用,将您的脚本放置在 app/src/main/assets/script.txt
  2. 应用会自动解析并显示您的脚本
  3. 开始说话,观察应用如何高亮显示您的当前位置
  4. 使用内置ASR模拟器进行测试,无需实际语音

🏗️ 架构设计

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   MainActivity  │◄───┤  AsrSimulator     │◄───┤   真实语音       │
│  (主活动)       │    │  (ASR模拟器)     │    │                 │
└─────────────────┘    └──────────────────┘    └─────────────────┘
         │                       │
         ▼                       ▼
┌─────────────────┐    ┌──────────────────┐
│ TeleprompterAd- │    │   ScriptEngine   │
│ apter (UI适配器)│◄───┤  (脚本引擎)      │
└─────────────────┘    └──────────────────┘
         │
         ▼
┌─────────────────┐
│  RecyclerView  │
│  (显示列表)      │
└─────────────────┘

🧪 测试

# 运行单元测试
./gradlew test

# 运行设备测试
./gradlew connectedAndroidTest

# 运行代码检查
./gradlew lint

📈 性能特点

  • 脚本解析: O(n)复杂度,使用协程进行后台处理
  • ASR匹配: O(1)滑动窗口算法,可配置搜索窗口大小
  • UI更新: 高效的RecyclerView,支持部分更新和Spannable优化
  • 内存: 针对大型脚本优化,使用预分配集合

🛠️ 配置选项

通过修改以下参数自定义应用行为:

// ASR匹配窗口大小
val windowSize = 50  // 向前搜索50个词

// 自动滚动设置
smoothScroller.calculateTimeForScrolling(dx: Int): Int = 150  // 滚动持续时间

// 高亮颜色
val highlightColor = Color.GREEN    // 高亮色
val normalTextColor = Color.GRAY     // 普通文本色

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Thanks to all contributors who have helped shape this project
  • Built with modern Android development practices
  • Inspired by the need for intelligent teleprompting solutions

Made with ❤️ for presenters and speakers worldwide

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages