💡 Important: TEN Framework currently only supports Python 3.10. It's recommended to use pyenv or venv to manage your Python environment:
Linux / macOS:
# Install and manage Python 3.10 using pyenv (recommended)pyenv install 3.10.14pyenv local 3.10.14# Or create virtual environment using venvpython3.10 -m venv ~/ten-venvsource ~/ten-venv/bin/activate
Make sure to check "Add Python to PATH" before clicking Install Now.
# On Windows, configure the python3 command:# First, find where python is installed:where.exe python# Example output: C:\Users\YourName\AppData\Local\Programs\Python\Python310\python.exe# Then, open PowerShell as Administrator and create a symlink in the same directory:New-Item -ItemType SymbolicLink -Path "C:\Users\YourName\AppData\Local\Programs\Python\Python310\python3.exe" -Target "C:\Users\YourName\AppData\Local\Programs\Python\Python310\python.exe"# Replace the paths above with the actual output from where.exe python# Verify:python3 --version
# It's recommended to create a venv after installationpy -3.10 -m venv $env:USERPROFILE\ten-venv# Activate the environment& "$env:USERPROFILE\ten-venv\Scripts\Activate.ps1"# If you encounter a permission error, close the terminal/IDE, right-click and select "Run as Administrator" to reopen# Or change the execution policy to allow ps1 scriptsSet-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
# First, make sure winget is available.winget --version# If not, install it from <https://apps.microsoft.com/detail/9nblggh4nns1?hl=en-US&gl=US># (Requires Windows 10 version 1709 (Build 16299) or later, or Windows 11)# Install MinGWwinget install BrechtSanders.WinLibs.POSIX.MSVCRT# Or search and choose a suitable version to installwinget search "mingw"# Verify installationgcc --version
💡 Tip: If any of the above is missing, please install the required version before continuing.
cd ten-framework# Linux/macOSbash tools/tman/install_tman.sh# Windows& "C:\sw\ten-framework\tools\tman\install_tman.ps1"
💡 Note: If tman is already installed on your system, the installation script will ask whether you want to reinstall/upgrade it. Press y to continue or n to cancel.
Non-interactive Installation (for automation scripts or CI environments, not available on Windows):
# Remote installationyes y | bash <(curl -fsSL https://raw.githubusercontent.com/TEN-framework/ten-framework/main/tools/tman/install_tman.sh)# Local installationyes y | bash tools/tman/install_tman.sh
Verify Installation:
tman --version
💡 Tip: If you see tman: command not found (Linux/macOS) or a similar unrecognized command error (Windows), make sure the tman directory is in your PATH:
# Check if tman is in PATH$env:Path -split ";" | Select-String "tman"# If not, either:# 1. Add it manually via "System Properties → Environment Variables", then restart your terminal# 2. Or temporarily add the path with:$env:PATH += ";$env:LOCALAPPDATA\tman"
Before running the app, you need to configure the ASR (Automatic Speech Recognition) service credentials. The current example uses Azure ASR extension. You need to fill in the configuration in the transcriber_demo/.env file:
Linux / macOS:
# Create .env filecat > .env << EOF# Azure Speech Service ConfigurationAZURE_STT_KEY=your_azure_speech_api_keyAZURE_STT_REGION=your_azure_region # e.g., eastusAZURE_STT_LANGUAGE=en-US # Set according to your audio language or real-time recording language, e.g., zh-CN, ja-JP, ko-KR, etc.EOF
💡 Tip: Windows users can also create the .env file directly with a text editor and fill in the configuration above.
💡 Tip: If you want to use other ASR extensions (such as OpenAI Whisper, Google Speech, etc.), you can download and replace them from the cloud store. Similarly, configure the corresponding API keys and environment variables in the .env file.
Using WebRTC VAD (Voice Activity Detection) extension as an example, install a C++ extension from the cloud store:
cd transcriber_demotman install extension webrtc_vad_cpp
💡 Note: webrtc_vad_cpp is a voice activity detection extension implemented in C++. It can filter out non-speech segments in real-time speech recognition scenarios.
[web_audio_control_go] Web server started on port 8001[vad] WebRTC VAD initialized with mode 2[audio_file_player_python] AudioFilePlayerExtension on_start
Now open your browser at http://localhost:8001 and navigate to the microphone real-time transcription page. You'll see the silence state changes after VAD processing. When the silence state is true, it indicates there is no speech in the current audio.
Developing and compiling C++ extensions requires installing a C++ compiler (gcc or clang):
Linux:
# Ubuntu/Debiansudo apt-get install gcc g++# Or use clangsudo apt-get install clang
macOS:
# Install Xcode Command Line Tools (includes clang)xcode-select --install
Windows:
# Option 1: Install Visual Studio Build Tools (recommended)# Download from https://visualstudio.microsoft.com/visual-cpp-build-tools/# Option 2: Install via wingetwinget install Microsoft.VisualStudio.2022.BuildTools --override "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --passive"# 💡 Note:# - Select the "Desktop development with C++" workload during installation# - Make sure to check "C++ Clang tools for Windows"
# Set proxy# Linux/macOSexport GOPROXY=https://goproxy.cn,direct# Windows PowerShell$env:GOPROXY = "https://goproxy.cn,direct"# Clean Go module cachego clean -modcache# Reinstall dependenciescd transcriber_demotman run build