← 返回
内容创作 Key 中文

Language Tutor

Create language learning audio with SenseAudio TTS, including pronunciation drills, bilingual lessons, slowed speech practice, and dialogue exercises. Use wh...
使用SenseAudio TTS创建语言学习音频,包括发音练习、双语课程、慢速语音练习和对话练习。使用...
scikkk
内容创作 clawhub v1.0.2 2 版本 100000 Key: 需要
★ 0
Stars
📥 710
下载
💾 18
安装
2
版本
#latest

概述

SenseAudio Language Tutor

Create interactive language-learning audio with official SenseAudio TTS endpoints and parameters.

What This Skill Does

  • Generate pronunciation examples in supported voices
  • Create bilingual vocabulary and sentence practice audio
  • Produce slowed-speed listening drills for learners
  • Build short dialogue exercises with repetition pauses
  • Export lesson audio files and companion study notes

Credential and Dependency Rules

  • Read the API key from SENSEAUDIO_API_KEY.
  • Send auth only as Authorization: Bearer .
  • Do not place API keys in query parameters, logs, or saved examples.
  • If Python helpers are used, this skill expects python3, requests, and pydub.
  • pydub may also require a local audio backend such as ffmpeg; if unavailable, prefer writing individual audio files instead of merging them.

Official TTS Constraints

Use the official SenseAudio TTS rules summarized below:

  • HTTP endpoint: POST https://api.senseaudio.cn/v1/t2a_v2
  • Model: SenseAudio-TTS-1.0
  • Max text length: 10000 characters
  • voice_setting.voice_id is required
  • voice_setting.speed range: 0.5-2.0
  • Optional audio format values: mp3, wav, pcm, flac
  • Optional sample rates: 8000, 16000, 22050, 24000, 32000, 44100
  • Optional MP3 bitrates: 32000, 64000, 128000, 256000
  • Optional channels: 1 or 2

Recommended Workflow

  1. Prepare lesson content:
    • Split vocabulary, example sentences, and dialogues into short chunks.
    • Keep each API call comfortably below the 10000 character limit.
  1. Build minimal TTS requests:
    • Send model, text, stream, and voice_setting.voice_id.
    • Add speed, pitch, vol, and audio_setting only when needed.
  1. Decode and save audio safely:
    • HTTP responses return hex-encoded audio in data.audio; decode before saving.
    • Keep filenames deterministic and avoid exposing secrets in paths or logs.
  1. Compose lessons carefully:
    • If pydub and an audio backend are available, merge clips and insert silence.
    • Otherwise, emit per-word or per-sentence clips and a manifest/Markdown study guide.
  1. Handle failures and traceability:
    • Check HTTP status and provider error payloads before decoding audio.
    • Record trace_id only for troubleshooting and avoid showing it unless needed.

Minimal Helper

import binascii
import os

import requests

API_KEY = os.environ["SENSEAUDIO_API_KEY"]
API_URL = "https://api.senseaudio.cn/v1/t2a_v2"


def generate_tts(text, voice_id="male_0004_a", speed=1.0, stream=False):
    payload = {
        "model": "SenseAudio-TTS-1.0",
        "text": text,
        "stream": stream,
        "voice_setting": {
            "voice_id": voice_id,
            "speed": speed,
        },
        "audio_setting": {
            "format": "mp3",
            "sample_rate": 32000,
            "bitrate": 128000,
            "channel": 2,
        },
    }
    response = requests.post(
        API_URL,
        headers={
            "Authorization": f"Bearer {API_KEY}",
            "Content-Type": "application/json",
        },
        json=payload,
        timeout=60,
    )
    response.raise_for_status()
    data = response.json()
    audio_hex = data["data"]["audio"]
    return binascii.unhexlify(audio_hex), data.get("trace_id")

Patterns

Vocabulary Drill

  • Generate one clip for the target word
  • Generate one clip for an example sentence
  • Optionally generate a slower clip at speed=0.8
  • Save clips separately or merge with pauses

Bilingual Lesson

  • Alternate source phrase and translated phrase
  • Use short pauses (1000-2000ms) between clips
  • Consider different voice_id values for source and translation when helpful

Dialogue Practice

  • Create one clip per line of dialogue
  • Insert repetition pauses after each line
  • Prefer shorter turns for easier debugging and regeneration

Output Options

  • Individual MP3 clips for words, sentences, or dialogue turns
  • Merged lesson audio if local audio tooling is available
  • Markdown study guide with transcript, translation, and file manifest

Safety Notes

  • Do not hardcode credentials.
  • Do not claim unsupported language-selection parameters for TTS unless the official docs add them.
  • Avoid assuming raw bytes can be passed directly to pydub.AudioSegment; decode and load through a supported container format.

版本历史

共 2 个版本

  • v1.0.2 当前
    2026-03-29 18:42 安全 安全
  • v1.0.0
    2026-03-14 04:44

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 860 📥 199,864
developer-tools

Meeting Assistant

scikkk
用于构建和排查 SenseAudio 会议助手,覆盖实时会议转写、说话人区分、实时翻译、会议纪要生成、行动项提取与转录导出。Build and troubleshoot SenseAudio meeting assistants for l
★ 1 📥 1,566
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,204