feat: add DashScope TTS provider and WeChat audio file sending - #3270
feat: add DashScope TTS provider and WeChat audio file sending#3270MrTreasure wants to merge 1 commit into
Conversation
- Add DashScopeTTSProvider for Bailian/DashScope TTS API
- Supports qwen3-tts-flash and other DashScope TTS models
- Auto-extracts workspace ID from Bailian MAAS base URL
- Downloads audio from OSS and returns WAV stream
- Integrates with existing provider framework via 'dashscope' protocol
- Add audio type detection in WeChat outboundMediaKind
- Detects audio/* MIME types and common audio file extensions
- Routes audio as file attachment (WeChat iLink bots cannot send
native voice bubbles - server-side limitation)
- Add tryTranscodeAudioToSilk helper for WeChat voice transcoding
- ffmpeg decode to 24kHz mono PCM → silk_encoder -tencent SILK
- Ready for future use when WeChat lifts voice bubble restriction
- Add UploadMediaTypeVoice / VoiceItem support in sendUploadedMedia
- Forward-looking: VoiceItem structure is accepted by iLink API
but silently dropped on delivery (platform limitation)
Co-Authored-By: Claude <noreply@anthropic.com>
5aaaad1 to
4a0ca8b
Compare
|
This PR has had no activity for 7 days and has been marked as stale. If you are still working on it, please push an update or leave a comment; otherwise it will be closed automatically in 7 days. |
|
Status update: this change is still actively maintained and remains needed for the WeChat deployment. I have rechecked the affected DashScope TTS, configuration, and WeChat audio delivery paths against the current upstream master; the targeted configuration and WeChat package tests pass locally. The branch is mergeable, and I am available to address review feedback or make any requested API adjustments. |
|
This PR has had no activity for 7 days and has been marked as stale. If you are still working on it, please push an update or leave a comment; otherwise it will be closed automatically in 7 days. |
|
This PR has been closed after 14 days of inactivity. If you would like to continue, feel free to reopen it or submit a new PR. |
Summary
This PR adds DashScope (Bailian) TTS support and WeChat audio file sending to picoclaw.
Changes
1. DashScope TTS Provider (
pkg/audio/tts/dashscope_tts.go— new file)A complete TTS provider for Alibaba Cloud DashScope/Bailian platform:
aigc/multimodal-generation/generationAPIqwen3-tts-flashand other DashScope TTS modelssend_ttstool2. TTS Provider Routing (
pkg/audio/tts/tts.go)Adds
case "dashscope"toproviderFromModelConfig:extra_bodyapi_baseor default DashScope base URL3. WeChat Audio Support (
pkg/channels/weixin/media.go)outboundMediaKind: Detectsaudio/*MIME types and common audio extensions — routes as file attachmentsendUploadedMedia: AddsUploadMediaTypeVoicecase withVoiceItem(forward-looking)tryTranscodeAudioToSilk: ffmpeg PCM decode + silk_encoder-tencent→ WeChat SILKPlatform Limitation
WeChat iLink bot API silently drops outbound VoiceItem messages. Audio is routed as file attachment which works reliably. SILK transcode + VoiceItem code paths preserved for future.
🤖 Generated with Claude Code