-
Notifications
You must be signed in to change notification settings - Fork 3
/
BVC.py
22 lines (18 loc) · 911 Bytes
/
BVC.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import requests
requests.packages.urllib3.disable_warnings()
def getAnalysis(API_Key,WavPath):
res = requests.post("https://token.beyondverbal.com/token",data={"grant_type":"client_credentials","apiKey":API_Key})
token = res.json()['access_token']
headers={"Authorization":"Bearer "+token}
pp = requests.post("https://apiv3.beyondverbal.com/v3/recording/start",json={"dataFormat": { "type":"WAV" }},verify=False,headers=headers)
recordingId = pp.json()['recordingId']
with open(WavPath,'rb') as wavdata:
r = requests.post("https://apiv3.beyondverbal.com/v3/recording/"+recordingId,data=wavdata, verify=False, headers=headers)
return r.json()
json = getAnalysis("API_KEY_GOES_HERE","audio_test_boredsad.wav")
print(json)
# * Sadness/Uncertainty/Boredom
# * Anger/Dislike/Stress
# * Neutral
# * Happiness/Enthusiasm/Friendliness
# * Warmth/Calmness