Gender Recognition
Predict the gender of the speaker in an audio sample
1. Submit job
Endpoint
POSThttps://speakerscope.ai/api/gender
Fields
| Field | Type | Description |
|---|---|---|
audio_url | string | URL of the audio file |
Example
import requests
response = requests.post(
"https://speakerscope.ai/api/gender",
auth=("<API_KEY>", "<API_SECRET>"),
json={
"audio_url": "<AUDIO_URL>",
},
)
print(response.json())Response
| Field | Type | Description |
|---|---|---|
job_id | str | Job identifier used to poll for the result |
{
"job_id": "cca90f61-c3f4-496b-a33c-6d77a4ce92bf"
}2. Get results
Endpoint
GEThttps://speakerscope.ai/api/status/{job_id}
Example
import requests
response = requests.get(
"https://speakerscope.ai/api/status/<JOB_ID>",
auth=("<API_KEY>", "<API_SECRET>"),
)
print(response.json())Response
Status
| Field | Type | Description |
|---|---|---|
status | str | "pending", "completed", or "failed" |
progress | str (optional) | Progress description (when "pending") |
error | str (optional) | Error message (when "failed") |
Result
| Field | Type | Description |
|---|---|---|
prediction | str | Predicted gender ("male" or "female") (when "completed") |
probabilities | dict[str, float] | Maps gender labels to their confidence scores, sorted in descending order (when "completed") |
Pending
{
"status": "pending",
"progress": "Predicting..."
}Completed
{
"status": "completed",
"prediction": "male",
"probabilities": {
"male": 0.97,
"female": 0.03
}
}