Skip to content Skip to sidebar Skip to footer

Train Custom Voice Using Azure Ai

I need help in completing one of my project work which says 'train a custom voice using Azure AI programmatically(python preferred)', not with the custom voice portal. Since I'm ve

Solution 1:

As far as I know, Azure has not released these APIs yet, but I tried to fetch HTTP requests via browser and these is my findings below.

1. Upload data set:

URL:

POST https://<your service name>.cognitiveservices.azure.com/speechtotext/v3.0/datasets

Header:

Content-Type: application/jsonOcp-Apim-Subscription-Key: <key>

Body:

{"displayName":"<name>","description":"<description>","dataImportKind":"<dataset kind>","datasetKind":"<dataset kind>","kind":"<dataset kind>","sourceUrl":"<dataset URL>","contentUrl":"<dataset URL>","locale":"<locale, ie, en-us>","project":{"id":"<your project ID>","self":"https:///<your service name>.cognitiveservices.azure.com/speechtotext/v3.0/projects/<your project ID>"},"properties":{"email":"<contactor email>"},"customProperties":{"PortalAPIVersion":"3"},"email":"<contactor email>"}

For dataset kind, if you select "Audio + human-labeled transcript" its value is Acoustic, for Plain text its value is language. for Pronunciation its value is Pronunciation.

2. Train a model:

URL

POST https://<NAME>.cognitiveservices.azure.com/speechtotext/v3.0/models

Headers:

Content-Type: application/jsonOcp-Apim-Subscription-Key: <key>

Body:

{
    "displayName": "<name>",
    "description": "<desp>",
    "locale": "en-US",
    "project": {
        "id": "<project ID>",
        "self": "https:///<your service name>.cognitiveservices.azure.com/speechtotext/v3.0/projects/<project ID>"
    },
    "properties": {
        "email": "<email>"
    },
    "customProperties": {
        "PortalAPIVersion": "3"
    },
    "email": "<email>",
    "datasets": [{
            "id": "<dataset id>",
            "self": "https:///<your service name>.cognitiveservices.azure.com/speechtotext/v3.0/datasets/<dataset id>"
        }...
    ]
    }
}

You can get project id and by API below:

GET https://<YOUR SERVICE NAME>.cognitiveservices.azure.com/speechtotext/v3.0/projects

You can get dataset id by API below:

GET https://<YOUR SERVICE NAME>.cognitiveservices.azure.com/speechtotext/v3.0/projects/<project id>

You can get model id by API below:

GET https://<YOUR SERVICE NAME>.cognitiveservices.azure.com/speechtotext/v3.0/projects/<project id>

3. Deploy model:

URL :

POST https://<NAME>.cognitiveservices.azure.com/speechtotext/v3.0/endpoints

Headers:

Content-Type: application/jsonOcp-Apim-Subscription-Key: <key>

Body:

{"displayName":"<name>","description":"<description>","locale":"<locale>","project":{"id":"<project id>","self":"https:///<your service name>.cognitiveservices.azure.com/speechtotext/v3.0/projects/<project id>"},"model":{"id":"<model id>","self":"https:///<your service name>.cognitiveservices.azure.com/speechtotext/v3.0/models/<model id>"},"properties":{"email":"<email>","contentLoggingEnabled":false,"loggingEnabled":false},"customProperties":{"contentLoggingEnabled":false,"PortalAPIVersion":"3"},"email":"<email>"}

You can get model id by API below:

GET https://<YOUR SERVICE NAME>.cognitiveservices.azure.com/speechtotext/v3.0/projects/<project id>/models

Post a Comment for "Train Custom Voice Using Azure Ai"