# Response Payload

## Complete Payload

<details>

<summary>ASR+Translate+TTS</summary>

{% code lineNumbers="true" %}

```json
{
    "pipelineResponse": [
        {
            "taskType": "asr",
            "config": {
                "serviceId": "ai4bharat/conformer-hi-gpu--t4",
                "language": {
                    "sourceLanguage": "hi",
                    "sourceScriptCode": ""
                },
                "audioFormat": "flac",
                "encoding": null,
                "samplingRate": 16000,
                "postProcessors": null
            },
            "output": [
                {
                    "source": "मेरा नाम महीर है और मैं भाषा यूज़ कर रहा हूँ"
                }
            ],
            "audio": null
        },
        {
            "taskType": "translation",
            "config": null,
            "output": [
                {
                    "source": "मेरा नाम महीर है और मैं भाषा यूज़ कर रहा हूँ",
                    "target": "माझे नाव माहिर आहे आणि मी भाषेच वापरत आहे"
                }
            ],
            "audio": null
        },
        {
            "taskType": "tts",
            "config": {
                "language": {
                    "sourceLanguage": "mr",
                    "sourceScriptCode": ""
                },
                "audioFormat": "wav",
                "encoding": "base64",
                "samplingRate": 22050,
                "postProcessors": null
            },
            "output": null,
            "audio": [
                {
                    "audioContent": "{{returned_base64_content}}",
                    "audioUri": null
                }
            ]
        }
    ]
}
```

{% endcode %}

</details>

The above JSON Response shows the output of the combination of ASR, Translation and TTS task requested by the integrator in that order. Below we will discuss the individual task response as well as combination of tasks in specific sequence.

## Response for Payload sent for Individual Task Request

{% tabs %}
{% tab title="ASR" %}
{% code lineNumbers="true" %}

```json
{
    "taskType": "asr",
    "config": {
        "serviceId": "xxxxx--ssssss-d-ddd--dddd",
        "language": {
            "sourceLanguage": "hi",
            "sourceScriptCode": ""
        },
        "audioFormat": "flac",
        "encoding": null,
        "samplingRate": 16000,
        "postProcessors": null
    },
    "output": [
        {
            "source": "मेरा नाम महीर है और मैं भाषा यूज़ कर रहा हूँ"
        }
    ],
    "audio": null
}
```

{% endcode %}

For **`individual ASR task request`** sent by the integrator, the response will contain only one dictionary where **`taskType`** will be **`asr`**.&#x20;

### Parameter: `config`

**`config`** parameter returns the configuration details of the output generated.

### Parameter: `output`

**`output`** parameter

contains

**`source`** parameter which gives the actual digital text of the audio sent as a part of the request as detailed [here](https://bhashini.gitbook.io/bhashini-apis/request-payload#request-payload-for-individual-task).
{% endtab %}

{% tab title="Translation" %}

{% code lineNumbers="true" %}

```json
{
    "taskType": "translation",
    "config": null,
    "output": [
        {
            "source": "मेरा नाम महीर है और मैं भाषा यूज़ कर रहा हूँ",
            "target": "माझे नाव माहिर आहे आणि मी भाषेच वापरत आहे"
        }
    ],
    "audio": null
}
```

{% endcode %}

For **`individual Translation task request`** sent by the integrator, the response will contain only one dictionary where **`taskType`** will be **`translation`**.&#x20;

### Parameter: `config`

**`config`** parameter returns the configuration details of the output generated.

### Parameter: `output`

**`output`** parameter

contains

**`source`** parameter which shows the digital text which was sent as an input as a part of the request.

**`source`** parameter which gives the actual digital text of the audio sent as a part of the request as detailed [here](https://bhashini.gitbook.io/bhashini-apis/request-payload#request-payload-for-individual-task).
{% endtab %}

{% tab title="TTS" %}
{% code lineNumbers="true" %}

```json
{
    "taskType": "tts",
    "config": {
        "language": {
            "sourceLanguage": "mr",
            "sourceScriptCode": ""
        },
        "audioFormat": "wav",
        "encoding": "base64",
        "samplingRate": 22050,
        "postProcessors": null
    },
    "output": null,
    "audio": [
        {
            "audioContent": "{{returned_base64_content}}",
            "audioUri": null
        }
    ]
}
```

{% endcode %}

For **`individual TTS task request`** sent by the integrator, the response will contain only one dictionary where **`taskType`** will be **`tts`**.&#x20;

### Parameter: `config`

**`config`** parameter returns the configuration details of the output generated.

### Parameter: `audio`

**`audio`** parameter

contains

**`audioContent`** parameter which gives the **`base64 encoded content`** of the audio content generated on the server and returned. The same shall be converted for a **`wav`** file which can then be heard by the integrator.
{% endtab %}
{% endtabs %}

## Response for Payload sent for Individual Task Request

{% tabs %}
{% tab title="ASR+Translation" %}
Output of **`ASR+Translation`** comes in the form of combination of **`ASR`** and **`Translation`** dictionary as detailed [above](#response-for-payload-sent-for-individual-task-request).

{% code lineNumbers="true" %}

```json
{
    "pipelineResponse": [
        {
            "taskType": "asr",
            "config": {
                "serviceId": "xxxxx--ssssss-d-ddd--dddd",
                "language": {
                    "sourceLanguage": "hi",
                    "sourceScriptCode": ""
                },
                "audioFormat": "flac",
                "encoding": null,
                "samplingRate": 16000,
                "postProcessors": null
            },
            "output": [
                {
                    "source": "मेरा नाम महीर है और मैं भाषावर्ष यूज़ कर रहा हूँ"
                }
            ],
            "audio": null
        },
        {
            "taskType": "translation",
            "config": null,
            "output": [
                {
                    "source": "मेरा नाम महीर है और मैं भाषावर्ष यूज़ कर रहा हूँ",
                    "target": "माझे नाव माहिर आहे आणि मी भाषेचे वर्ष वापरत आहे"
                }
            ],
            "audio": null
        }
    ]
}
```

{% endcode %}
{% endtab %}

{% tab title="Translation+TTS" %}
Output of **`Translation+TTS`** comes in the form of combination of **`Translation`** and **`TTS`** dictionary as detailed [above](#response-for-payload-sent-for-individual-task-request).

{% code lineNumbers="true" %}

```json
{
    "pipelineResponse": [
        {
            "taskType": "translation",
            "config": null,
            "output": [
                {
                    "source": "मेरा नाम महीर है और मैं भाषावर्ष यूज़ कर रहा हूँ",
                    "target": "माझं नाव माहिर आहे आणि मी भाषेचे वर्ष वापरत आहे."
                }
            ],
            "audio": null
        },
        {
            "taskType": "tts",
            "config": {
                "language": {
                    "sourceLanguage": "mr",
                    "sourceScriptCode": ""
                },
                "audioFormat": "wav",
                "encoding": "base64",
                "samplingRate": 22050,
                "postProcessors": null
            },
            "output": null,
            "audio": [
                {
                    "audioContent": "{{generated_base64_content}}",
                    "audioUri": null
                }
            ]
        }
    ]
}
```

{% endcode %}
{% endtab %}

{% tab title="ASR+Translation+TTS" %}
Output of ASR+Translation+TTS comes in the form of combination of **`ASR`**, **`Translation`** and **`TTS`** dictionary as detailed [above](#response-for-payload-sent-for-individual-task-request).

{% code lineNumbers="true" %}

```json
{
    "pipelineResponse": [
        {
            "taskType": "asr",
            "config": {
                "serviceId": "ai4bharat/conformer-hi-gpu--t4",
                "language": {
                    "sourceLanguage": "hi",
                    "sourceScriptCode": ""
                },
                "audioFormat": "flac",
                "encoding": null,
                "samplingRate": 16000,
                "postProcessors": null
            },
            "output": [
                {
                    "source": "मेरा नाम महीर है और मैं भाषा वर्ष यूज़ कर रहा हूँ"
                }
            ],
            "audio": null
        },
        {
            "taskType": "translation",
            "config": null,
            "output": [
                {
                    "source": "मेरा नाम महीर है और मैं भाषा वर्ष यूज़ कर रहा हूँ",
                    "target": "माझे नाव माहिर आहे आणि मी भाषेचे वर्ष वापरत आहे"
                }
            ],
            "audio": null
        },
        {
            "taskType": "tts",
            "config": {
                "language": {
                    "sourceLanguage": "mr",
                    "sourceScriptCode": ""
                },
                "audioFormat": "wav",
                "encoding": "base64",
                "samplingRate": 22050,
                "postProcessors": null
            },
            "output": null,
            "audio": [
                {
                    "audioContent": "{{generated_base64_content}}",
                    "audioUri": null
                }
            ]
        }
    ]
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
