Skip to content

SEERNET/Audio-Emotion-Recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Audio-Emotion-Recognition

Emotion recognition api extract basic emotions, intensity, & sentiment from the audio file. It can be used with DeepAffects Speaker Identification API.

POST Request

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

Sample Code

Shell

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"}

Output

# 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
    }]
}
}

Body Parameters

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.

Query Parameters

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 Parameters

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.

Output Parameters (Async)

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

Output Parameters (Webhook)

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.

About

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

About

Directly from voice, recognise speaker emotion, intensity, & sentiment in speaker utterances.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published