Emotion recognition api extract basic emotions, intensity, & sentiment from the audio file. It can be used with DeepAffects Speaker Identification API.
POST https://proxy.api.deepaffects.com/audio/generic/api/v2/sync/recognise_emotion
POST https://proxy.api.deepaffects.com/audio/generic/api/v2/async/recognise_emotion
curl -X POST "https://proxy.api.deepaffects.com/audio/generic/api/v2/sync/recognise_emotion?apikey=<API_KEY>" -H 'content-type: application/json' -d @data.json
curl -X POST "https://proxy.api.deepaffects.com/audio/generic/api/v2/async/recognise_emotion?apikey=<API_KEY>&webhook=<Your webhook url>&request_id=abcd-1234" -H 'content-type: application/json' -d @data.json
# contents of data.json
{"content": "bytesEncodedAudioString", "sampleRate": 8000, "encoding": "FLAC", "languageCode": "en-US"}
# Sync:
{
"segments":
[{
"emotion": "joy",
"start": 0,
"end": 1
}]
}
# Async:
{
"request_id": "8bdd983a-c6bd-4159-982d-6a2471406d62",
"api": "requested_api_name"
}
# Webhook:
{
"request_id": "8bdd983a-c6bd-4159-982d-6a2471406d62",
"response": {
"segments":
[{
"emotion": "joy",
"start": 0,
"end": 1
}]
}
}
Parameter | Type | Description | Notes |
---|---|---|---|
encoding | String | Encoding of audio file like MP3, WAV etc. | |
sampleRate | Number | Sample rate of the audio file. | |
languageCode | String | Language spoken in the audio file. | [default to 'en-US'] |
content | String | base64 encoding of the audio file. |
Parameter | Type | Description | Notes |
---|---|---|---|
api_key | String | The apikey | Required for authentication inside all requests |
webhook | String | The webhook url at which the responses will be sent | Required for async requests |
request_id | Number | An optional unique id to link async response with the original request | Optional |
Output is the list of emotion scores. The parameters in emotion scores are as follows:
Parameter | Type | Description | Notes |
---|---|---|---|
emotion | String | Type of emotion like Happy, Sad, Surprised etc. | |
start | Float | Start of the audio segment. | |
end | Float | end of the audio segment. |
Parameter | Type | Description | Notes |
---|---|---|---|
request_id | String | The request id | This defaults to the originally sent id or is generated by the api |
api | String | The api method which was called |
Parameter | Type | Description | Notes |
---|---|---|---|
request_id | String | The request id | This defaults to the originally sent id or is generated by the api |
response | Object | Response object same as sync api response. |
DeepAffects is a speech analysis platform for Developers. We offer a number of speech analysis apis like, Speech Enhancement, Multi-Speaker Diarization, Emotion Recognition, Voice-prints, Conversation Metrics etc. For more information, checkout our developer portal