The following python script may be used as a starting point for the Voicesense API integration.
Example usage:
Upload audio file
voicesense.py --username "USERNAME" --password "PASSWORD" upload --type=stereo --file "PATH-TO-FILE"
In response you will receive id of an audio upload.
Upload audio url
voicesense.py --username "USERNAME" --password "PASSWORD" upload --type=stereo --url "AUDIO-URL"
In response you will receive id of an audio upload.
Get product scores
python voicesense.py --username "USERNAME" --password "PASSWORD" predictor --id "ID" --product "PRODUCT_NAME"
In response you will receive scores object.
Check audio length
To run this command you will need free ffmpeg executable located in the same folder as python script.
python voicesense.py check_length --file "AUDIO_FILE_NAME"
In response you will receive an audio file length in seconds and information if and which products will be available; for less than 20s – no scores, between 20s and 40s – only Dashboard, for more then 40s all scores. Only audio files which are longer than 20s should be sent for scoring.