跳转至

MaaS_Az_tts/Op_tts

请求方法

POST

https://genaiapi-m2.cloudsway.net/v1/{endpoint}/audio/speech

参数 描述 示例
Authorization AccessKey Bearer ${AccessKey} Bearer xxxxxx

请求参数

参数 描述 示例
model 使用模型 MaaS_Az_tts
input 需要生成音频的文本 how are you
voice 当生成音频时可选用的声音 可选值: "alloy", "echo", "fable", "onyx", "nova", "shimmer" alloy
response_format 音频格式 可选值: "mp3", "opus", "aac", "flac", "wav", "pcm" mp3
speed 音频速度 范围是: 0.25 to 4.0. 1

返回值

文件流

请求示例

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{endpoint}/audio/speech' \
--header 'Authorization: Bearer xxxx' \
--header 'Content-Type: application/json' \
--data '{
    "input":"<speak version='\''1.0'\'' xml:lang='\''en-US'\''><voice xml:lang='\''en-US'\'' xml:gender='\''Female'\'' name='\''en-US-AvaMultilingualNeural'\''>my voice is my passport verify me</voice></speak>",
    "response_format":"audio-16khz-128kbitrate-mono-mp3"
}'

MaaS OSpeech

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{endpoint}/audio/speech' \
--header 'Authorization: Bearer xxxx' \
--header 'Content-Type: application/json' \
--data '{
    "input":"hi,what is your name?",
    "voice":"alloy",
    "speed":1.0,
    "response_format":"mp3"
}'

获取MaaS ASpeech区域语音列表

请求方法

GET

https://genaiapi-m2.cloudsway.net/v1/ai/{endpointPath}/cognitiveservices/voices/list

header

参数 描述 示例
Authorization AccessKey Bearer ${AccessKey} Bearer xxxxxx

请求样例

```plain text curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{endpointPath}/cognitiveservices/voices/list' \ --header 'Authorization: Bearer xxxx'

## 返回参数

对象数组

对象参数:

| **参数**          | **描述**   | **示例**                                                           |
| --------------- | -------- | ---------------------------------------------------------------- |
| Name            | 语音全称     | Microsoft Server Speech Text to Speech Voice (af-ZA, AdriNeural) |
| DisplayName     | 展示名称     | Adri                                                             |
| LocalName       | 本地名称     | Adri                                                             |
| ShortName       | 简称       | af-ZA-AdriNeural                                                 |
| Gender          | 语音性别     | Female                                                           |
| Locale          | 语言环境     | af-ZA                                                            |
| LocaleName      | 语言环境名称   | Afrikaans (South Africa)                                         |
| SampleRateHertz | 采样赫兹     | 48000                                                            |
| VoiceType       | 语音类型     | Neural                                                           |
| Status          | 状态       | GA                                                               |
| WordsPerMinute  | 每分钟读单词数量 | 147                                                              |

**Response**

```json
[
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (af-ZA, AdriNeural)",
        "DisplayName": "Adri",
        "LocalName": "Adri",
        "ShortName": "af-ZA-AdriNeural",
        "Gender": "Female",
        "Locale": "af-ZA",
        "LocaleName": "Afrikaans (South Africa)",
        "SampleRateHertz": "48000",
        "VoiceType": "Neural",
        "Status": "GA",
        "VoiceTag": {
            "ModelSeries": [
                "Monolingual"
            ],
            "Source": [
                "Azure"
            ],
            "TailoredScenarios": [
                "Assistant",
                "Narration"
            ],
            "VoicePersonalities": [
                "Well-Rounded",
                "Animated",
                "Bright"
            ]
        },
        "WordsPerMinute": "147"
    },
......
]