feat: add DashScope TTS provider and WeChat audio file sending#3270
Open
MrTreasure wants to merge 1 commit into
Open
feat: add DashScope TTS provider and WeChat audio file sending#3270MrTreasure wants to merge 1 commit into
MrTreasure 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>
MrTreasure
force-pushed
the
feat/dashscope-tts-weixin-audio
branch
from
July 20, 2026 11:57
5aaaad1 to
4a0ca8b
Compare
This was referenced Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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