Actions

Difference between revisions of "Broadcastify-Calls-API"

From The RadioReference Wiki

Line 4: Line 4:
 
   
 
   
 
  ffmpeg -i "${basename}.wav"  -c:a libfdk_aac -b:a 32k -cutoff 18000 "${basename}.m4a
 
  ffmpeg -i "${basename}.wav"  -c:a libfdk_aac -b:a 32k -cutoff 18000 "${basename}.m4a
<br>
 
 
<br>
 
<br>
  
Line 10: Line 9:
  
 
  ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "${basename}.m4a
 
  ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "${basename}.m4a
<br>
 
 
<br>
 
<br>
  
Line 25: Line 23:
 
Error return is an error code followed by an error message
 
Error return is an error code followed by an error message
 
  Example: 100 NO-API-KEY-SPECIFIED
 
  Example: 100 NO-API-KEY-SPECIFIED
<br>
 
 
<br>
 
<br>
  

Revision as of 14:32, 25 March 2020

Upload API

Convert to M4A AAC Audio
ffmpeg -i "${basename}.wav"  -c:a libfdk_aac -b:a 32k -cutoff 18000 "${basename}.m4a


Get the duration of the audio clip
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "${basename}.m4a


Register the Clip and get the Upload URL.

This is a RFC1867 multipart/form-data POST request to the API Endpoint.

curl -s https://api.broadcastify.com/call-upload -F "callDuration=${duration}" -F "filename=${NEWBASE}.m4a" 
-F "apiKey=${APIKEY}" -F "systemId=${SYSTEMID}" -F "ts=${timestamp}" -F "tg=${tg}" -F "src=${src}" -F "freq=${freq}"

Successful return is a single line with a return code followed by an upload URL.

Example: 0 https://upload.hostname.com/uploadPath

Error return is an error code followed by an error message

Example: 100 NO-API-KEY-SPECIFIED


Upload the Audio File
curl --write-out %{http_code} --silent --output /dev/null -X PUT -H "Content-Type: audio/aac" 
-T ${basename}.m4a "${uploadURL}