Task Objectives
- This Skill is used for: converting speech to text and providing intelligent text rewriting functionality
- Capabilities include:
- Real-time speech recognition (speech-to-text)
- Intelligent text rewriting (emails, notes, social media copy)
- Text concatenation (merging multiple recordings)
- One-click copy and share
- Trigger conditions: when the user requests "speech-to-text", "recording-to-text", "voice memo", etc.
Prerequisites
- Dependency description: Python libraries required for Qwen3-ASR invocation
requests>=2.28.0 numpy>=1.21.0 - No additional files or folder preparation required
Operation Steps
Standard process (speech-to-text + intelligent rewriting)
-
Record/Upload audio(provided by the caller)
- Click the record button to start recording
- Click stop to end recording
- Or upload an existing audio file
-
Speech-to-text(the agent invokes the script)
from scripts.asr_transcriber import Qwen3ASRTranscriber transcriber = Qwen3ASRTranscriber() result = transcriber.transcribe( audio_file="recording.wav", language="zh-CN" ) text = result["text"] -
Text rewriting(processed by the agent)
- Select the rewriting type according to user needs:
- Rewrite as email: formal and structured, including subject, body, and signature
- Rewrite as notes: clear key points and well-organized, using lists and markers
- Rewrite as social media copy: concise and engaging, using emojis and hashtags
- The agent analyzes the source content and identifies key information
- Adjusts tone, structure, and style according to the rewriting type
- Select the rewriting type according to user needs:
-
Copy/Share(processed by the agent)
- One-click copy: the agent copies the rewritten text to the clipboard
- One-click share: the agent generates a sharing format suitable for platforms such as WeChat
-
Recording splicing(processed by the agent)
- Continue recording to generate new text
- The agent splices the new text onto the original text
- Maintains text coherence and adds appropriate connectives
Multi-recording splicing process
- First recording: perform speech-to-text according to the standard process
- Continue recording: the user clicks continue recording
- Convert to text: call the script to recognize the new recording
- Intelligent splicing: the agent splices the new text onto the original text
# 智能体处理拼接 full_text = original_text + "\n\n" + new_text
Resource Index
- Required scripts:
- scripts/asr_transcriber.py(Purpose: speech-to-text, supports multiple audio formats and real-time recognition)
- Domain references:
- references/asr-api-config.md(When to read: when you need to understand ASR API configuration and parameters)
- references/text-rewrite-guide.md(When to read: when you need to understand text rewriting rules and templates)
- Output asset: No preset template; the rewritten text is dynamically generated according to requirements
Notes
- Recording quality: Ensure the recording is clear, with no excessive background noise, to improve recognition accuracy
- Text rewriting: Make full use of the agent's language understanding and creation capabilities, and avoid writing scripts for rewriting
- Concatenation coherence: When concatenating multiple recording segments, the agent should add appropriate connectives to keep the text coherent
- Rewriting accuracy: When rewriting, the core information and intent of the original text should be preserved, and content should not be arbitrarily added or removed
- Scenario adaptation: Choose the appropriate rewriting type according to the usage scenario (email/notes/social media)
Usage examples
Example 1: Meeting minutes to notes
Scenario: Record meeting audio and convert it into structured meeting notes
Execution process:
-
Record meeting audio (60 minutes)
-
Call the script to convert to text:
from scripts.asr_transcriber import Qwen3ASRTranscriber transcriber = Qwen3ASRTranscriber() result = transcriber.transcribe( audio_file="meeting.wav", language="zh-CN" ) meeting_text = result["text"] -
The agent rewrites it into notes:
# 会议笔记 ## 时间地点 - 时间:2024年1月23日 - 地点:公司会议室 ## 参会人员 - 张经理、李主管、王工程师 ## 主要议题 1. Q1业绩回顾 - 销售额增长20% - 新用户增加5000人 2. Q2工作计划 - 推出新产品线 - 加强市场推广 - 优化客户服务 3. 决议事项 - 批准新产品线预算 - 成立市场推广小组
Example 2: Voice to email
Scenario: Record a voice memo and convert it into a formal email
Execution process:
- Record a voice memo: "Xiao Wang, regarding tomorrow's project meeting, please prepare the following materials: project progress report, budget sheet, and team member list. The meeting time is 10 a.m., and the location is Meeting Room 3."
- Call the script to convert to text
- The agent rewrites it into an email:
主题:明天项目会议准备材料 小王: 你好! 关于明天上午10点在3号会议室召开的项目会议,请提前准备好以下材料: 1. 项目进度报告 2. 预算表 3. 团队人员名单 如有疑问,请及时联系我。 祝好! 张经理
Example 3: Voice to social media copy
Scenario: Record voice inspiration and convert it into social media post copy
Execution process:
- Record voice inspiration: "Today I tried an amazing coffee shop. The coffee was very rich, and the environment was very comfortable, very suitable for working. I recommend it to everyone!"
- Call the script to convert to text
- The agent rewrites it into social media copy:
☕️ 今日份咖啡推荐! 今天发现了一家宝藏咖啡店 ☕✨ 咖啡口感浓郁,环境舒适超治愈,简直是工作充电的好地方~ #咖啡探店 #工作日常 #周末好去处 📍 地址:[咖啡店名称] ⭐ 推荐:招牌拿铁、手冲咖啡
Example 4: Concatenating multiple recording segments
Scenario: Record a long voice message in multiple segments, and finally concatenate the complete text
Execution process:
-
First recording segment(0-10 minutes):
result1 = transcriber.transcribe("part1.wav") text1 = result1["text"] -
Second recording segment(10-20 minutes):
result2 = transcriber.transcribe("part2.wav") text2 = result2["text"] -
Third recording segment(20-30 minutes):
result3 = transcriber.transcribe("part3.wav") text3 = result3["text"] -
Agent concatenation:
完整文本: [第一段内容] ...(智能体添加连接词)... [第二段内容] ...(智能体添加连接词)... [第三段内容]
Example 5: One-click copy and share
Scenario: After voice-to-text, copy or share to WeChat with one click
Execution process:
- Voice-to-text
- The agent rewrites it into the target format
- One-click copy:
文本已复制到剪贴板! - One-click share to WeChat:
✅ 文本已生成,可以分享到微信 分享格式: [改写后的文本] #会议纪要 #工作效率
API reference
Qwen3ASRTranscriber class
Initialization:
Qwen3ASRTranscriber(api_key=None, base_url=None)
Main methods:
# 语音转文字
transcribe(
audio_file: str,
language: str = "zh-CN",
format: str = "wav",
sample_rate: int = 16000,
return_timestamps: bool = False
) -> dict
# 返回格式
{
"success": True,
"text": "识别的文字",
"language": "zh-CN",
"duration": 120.5,
"segments": [...] # 如果 return_timestamps=True
}