Closed JRomainG closed 5 years ago
Hello @JRock007, I've been struggling with the exact same issue. Have you had any success with it?
Hello @caluap
We're currently in process of refactoring the library:
Can you try out the following snippet:
import requests
import base64
url = "https://proxy.api.deepaffects.com/audio/generic/api/v2/sync/recognise_emotion"
querystring = {"apikey":"<API_KEY>"}
payload = {
"encoding": "Wave",
"languageCode": "en-US"
}
# The api accepts data as base64 encoded content
# passing payload as content:
with open(audio_file_name, 'rb') as fin:
audio_content = fin.read()
payload["content"] = base64.b64encode(audio_content).decode('utf-8')
headers = {
'Content-Type': "application/json",
}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.text)
Your code indeed solves this issue for me. Thanks for your help!
@JRock007 @sushant-hiray Can you provide API endpoints for diarization API?
@rowhitswami You should probably check the docs at https://docs.deepaffects.com/docs/speaker-diarization-api.html to get more info on how the diarization API works
@sushant-hiray it also worked here. Thanks a lot!
I'm trying to use the EmotionApi's
sync_recognise_emotion
with wav files, but get aBAD REQUEST
error.Note that I encountered the issue #18, but fixed it by creating my own copy of audio_from_file:
Using the created Audio instance, I try to call the API's emotion recognizer:
An
ApiException
is raised with the following info:It seems related to #35, but as I'm simply using the Python API, I don't think the solution mentioned there applies to my case. Do you have any clue if I'm doing anything wrong? I also tried different WAV files but to no avail.
pip show deepaffects
showsVersion: 1.4.1