Language Tutor
by @scikkk
Create language learning audio with SenseAudio TTS, including pronunciation drills, bilingual lessons, slowed speech practice, and dialogue exercises. Use wh...
clawhub install language-tutorπ About This Skill
name: senseaudio-language-tutor description: Create language learning audio with SenseAudio TTS, including pronunciation drills, bilingual lessons, slowed speech practice, and dialogue exercises. Use when users need language learning materials, pronunciation practice, or vocabulary audio. version: 1.0.0 metadata: openclaw: requires: env: - SENSEAUDIO_API_KEY bins: - python3 primaryEnv: SENSEAUDIO_API_KEY homepage: https://senseaudio.cn install: - kind: uv package: requests - kind: uv package: pydub # Optional runtime helper; pydub commonly needs ffmpeg available locally compatibility: required_credentials: - name: SENSEAUDIO_API_KEY description: API key from https://senseaudio.cn/platform/api-key env_var: SENSEAUDIO_API_KEY homepage: https://senseaudio.cn source: https://github.com/anthropics/skills
SenseAudio Language Tutor
Create interactive language-learning audio with official SenseAudio TTS endpoints and parameters.
What This Skill Does
Credential and Dependency Rules
SENSEAUDIO_API_KEY.Authorization: Bearer .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:
POST https://api.senseaudio.cn/v1/t2a_v2SenseAudio-TTS-1.010000 charactersvoice_setting.voice_id is requiredvoice_setting.speed range: 0.5-2.0mp3, wav, pcm, flac8000, 16000, 22050, 24000, 32000, 4410032000, 64000, 128000, 2560001 or 2Recommended Workflow
1. Prepare lesson content:
10000 character limit.2. Build minimal TTS requests:
model, text, stream, and voice_setting.voice_id.speed, pitch, vol, and audio_setting only when needed.3. Decode and save audio safely:
data.audio; decode before saving.4. Compose lessons carefully:
pydub and an audio backend are available, merge clips and insert silence.5. Handle failures and traceability:
trace_id only for troubleshooting and avoid showing it unless needed.Minimal Helper
import binascii
import osimport 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
speed=0.8Bilingual Lesson
1000-2000ms) between clipsvoice_id values for source and translation when helpfulDialogue Practice
Output Options
Safety Notes
pydub.AudioSegment; decode and load through a supported container format.