AS

aws-samples/sample-nova-sonic-speech2speech-webrtc

开发工具官方

本页由 AI 翻译,技术细节请以原文为准。 查看原文

21 stars 4 forks 质量 63 趋势 14MIT-0

基于亚马逊Nova 2 Sonic和亚马逊Kinesis视频流WebRTC服务的示例语音代理应用。

概览

一个全面的语音转语音(S2S)WebRTC解决方案,集成了AWS Bedrock Nova 2 Sonic、Amazon Kinesis视频流与WebRTC以及实时音频/视频处理。 - : 使用亚马逊KVS WebRTC实现低延迟音频流 - : 与AWS Bedrock Nova Sonic集成,实现高级语音对语音功能 - : 在Windows、macOS和Linux上无缝运行 - : 优化适用于开发和生产环境 - : 独立的Python后端和React前端以提升灵活性 - 支持MCP(模型上下文协议)和Strands代理 该方案已经过以下具体版本的测试和验证: - : 3.12.x - : 1.26.4(通过 conda 作为 av 依赖安装) - : 11.0.0(通过 conda 安装用于 FFmpeg 链接) - : 1.6.0(通过 pip 安装并带依赖管理) - : 6.1.

概述(AI 翻译)

一个全面的语音转语音(S2S)WebRTC解决方案,集成了AWS Bedrock Nova 2 Sonic、Amazon Kinesis视频流与WebRTC以及实时音频/视频处理。

示例解法架构:

🚀 特色

能力

  • 实时WebRTC通信:使用亚马逊KVS WebRTC实现低延迟音频流
  • AI驱动语音处理:与AWS Bedrock Nova Sonic集成,实现高级语音转语音功能
  • 跨平台支持:在Windows、macOS和Linux上无缝运行
  • 生产准备:针对开发和生产环境都进行了优化
  • 模块化架构:将Python后端和React前端分开以提升灵活性
  • 代理集成:支持MCP(模型上下文协议)和Strands代理

📋 系统需求

测试配置

该方案已经过以下具体版本的测试和验证:

核心依赖:

  • Python:3.12.x
  • numpy:1.26.4(通过 conda 作为 AV 依赖安装)
  • av(PyAV):11.0.0(通过conda安装用于FFmpeg链接)
  • aiortc:1.6.0(通过依赖管理PIP安装)
  • ffmpeg:6.1.2+(通过Conda安装)

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Nova S2S WebRTC Workshop

A comprehensive Speech-to-Speech (S2S) WebRTC solution integrating AWS Bedrock Nova 2 Sonic, Amazon Kinesis Video Streams with WebRTC, and real-time audio/video processing.

The sample solution architecture:

🚀 Features

Capabilities

  • Real-time WebRTC Communication: Low-latency audio streaming using Amazon KVS WebRTC
  • AI-Powered Speech Processing: Integration with AWS Bedrock Nova Sonic for advanced speech-to-speech capabilities
  • Cross-Platform Support: Works seamlessly on Windows, macOS, and Linux
  • Production Ready: Optimized for both development and production environments
  • Modular Architecture: Separate Python backend and React frontend for flexibility
  • Agent Integration: Support for MCP (Model Context Protocol) and Strands agents

📋 System Requirements

Tested Configuration

This solution has been tested and verified with the following exact versions:

Core Dependencies:

  • Python: 3.12.x
  • numpy: 1.26.4 (installed via conda as av dependency)
  • av (PyAV): 11.0.0 (installed via conda for FFmpeg linking)
  • aiortc: 1.6.0 (installed via pip with dependency management)
  • ffmpeg: 6.1.2+ (installed via conda)

AWS SDK:

  • boto3: ≥1.34.0
  • aws-sdk-bedrock-runtime: ≥0.0.1
  • smithy-aws-core: ≥0.1.0

Agent Integration:

  • mcp: ≥1.0.0
  • strands-agents: ≥0.1.0

Hardware Requirements

  • CPU: Multi-core processor (Intel i5/AMD Ryzen 5 or better recommended)
  • RAM: Minimum 4GB, 8GB recommended for optimal performance
  • Storage: At least 2GB free space for dependencies and build files
  • Network: Stable internet connection with low latency for real-time communication
  • Audio: Microphone and speakers/headphones for testing

Software Requirements

Cross-Platform Support

  • Windows: Windows 10 or later
  • macOS: macOS 10.15 (Catalina) or later (Intel and Apple Silicon)
  • Linux: Ubuntu 18.04+, CentOS 7+, or equivalent distributions

Python Backend

  • Python: 3.12 (required for AWS Bedrock runtime)
  • Conda: Miniconda or Anaconda (required for proper FFmpeg/PyAV linking)
  • System Dependencies: ffmpeg, pkg-config (automatically handled by conda)

React Frontend

  • Node.js: 16.0 or higher (18.x LTS recommended)
  • npm: 8.0 or higher (comes with Node.js)
  • Browser: Modern browser with WebRTC support (Chrome 80+, Firefox 75+, Safari 14+, Edge 80+)

AWS Requirements

  • AWS Account: Active AWS account with appropriate permissions
  • AWS Services Access:
    • Amazon Kinesis Video Streams
    • AWS Bedrock (Nova Sonic model access)
    • IAM permissions for KVS and Bedrock

🏗️ Project Structure

sample-nova-sonic-speech2speech-webrtc/
├── README.md                    # This file
├── start-python-server.sh      # Python server launcher script (cross-platform)
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →