本帖最后由 小白龙 于 2024-11-24 09:12 编辑
最近发现海螺语音的效果不错, 用手机号注册后有100万的token免费使用, 就参考官方的CURL代码用GPT转成powershell来测试, 但是改了得有上百遍, 死活就是报错, 代码中也没有存成mp3的部分,这也让人头疼
base_resp
---------
@{status_code=1000; status_msg=amadeus resp audioInfo.URL is invalid}
求路过大佬指导, 多谢
官方链接:
https://platform.minimaxi.com/do ... 005a427f0c8a5701643
官方CURL代码 | group_id="请填写您的group_id" | | api_key="请填写您的api_key" | | curl --location 'https: | | --header 'Authorization: Bearer $MiniMax_API_KEY' \ | | --header 'Content-Type: application/json' \ | | --data '{ | | "model": "speech-01-turbo", | | "text": "真正的危险不是计算机开始像人一样思考,而是人开始像计算机一样思考。计算机只是可以帮我们处理一些简单事务。", | | "stream": false, | | "voice_setting":{ | | "voice_id": "male-qn-qingse", | | "speed": 1, | | "vol": 1, | | "pitch": 0 | | "emotion": "happy" | | }, | | "pronunciation_dict":{ | | "tone": ["处理/(chu3)(li3)", "危险/dangerous"] | | }, | | "audio_setting":{ | | "sample_rate": 32000, | | "bitrate": 128000, | | "format": "mp3", | | "channel": 1 | | } | | }'COPY |
GPT写的powershell代码, 会报错 | | | $group_id = "改自己的, 在 https://platform.minimaxi.com/user-center/basic-information?key=66719005a427f0c8a5701643&document=T2A+V2" | | $api_key = "改自己的, 在 https://platform.minimaxi.com/user-center/basic-information?key=66719005a427f0c8a5701643&document=T2A+V2" | | | | | | $jsonData = @{ | | model = "speech-01-turbo" | | text = "真正的危险不是计算机开始像人一样思考,而是人开始像计算机一样思考。计算机只是可以帮我们处理一些简单事务。" | | stream = $false | | voice_setting = @{ | | voice_id = "male-qn-qingse" | | speed = 1 | | vol = 1 | | pitch = 0 | | emotion = "happy" | | } | | pronunciation_dict = @{ | | tone = @("处理/(chu3)(li3)", "危险/dangerous") | | } | | audio_setting = @{ | | sample_rate = 32000 | | bitrate = 128000 | | format = "mp3" | | channel = 1 | | } | | } | | | | | | $jsonString = $jsonData | ConvertTo-Json -Depth 3 -Compress | | | | | | $response = Invoke-RestMethod -Uri "https://api.minimax.chat/v1/t2a_v2?GroupId=$group_id" ` | | -Method Post ` | | -Headers @{ | | "Authorization" = "Bearer $api_key" | | "Content-Type" = "application/json" | | } ` | | -Body $jsonString | | | | | | $responseCOPY |
|