Audio Language Detection Compute Call
The Audio Language Detection (ALD) compute call identifies the spoken language from audio streams or base64 audio recordings across Indian languages.
POST https://dhruva-api.bhashini.gov.in/services/inference/pipelineRequest Schema→
Request Payload Specification
Understand audioContent (base64) and audioUri input payloads with service configuration.
Response Schema→
Response Payload Specification
Inspect detected language code, confidence scores, and structured JSON outputs.
1-Minute Quick Call
Detect the spoken language of an audio snippet with your inference API key:
JavaScript (fetch)
const url = "https://dhruva-api.bhashini.gov.in/services/inference/pipeline";
const headers = {
"Content-Type": "application/json",
"Accept": "*/*",
"Authorization": "<YOUR_INFERENCE_API_KEY>"
};
const payload = {
pipelineTasks: [
{
taskType: "audio-lang-detection",
config: {
serviceId: "bhashini/iitmandi/ald"
}
}
],
inputData: {
audio: [
{
audioContent: "<BASE64_ENCODED_AUDIO_STRING>"
}
]
}
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
const data = await response.json();
console.log(data);Required Headers
| Header | Type | Required | Description |
|---|---|---|---|
Content-Type | string | Required | Standard JSON request body (application/json). |
Accept | string | Required | Expected response format (*/*). |
Authorization | string | Required | Raw inference API key (without Bearer). |