Audio Driver API Information
1. Play Audio
Description:This API can be used to play audio
URI: /audio/play
Method: POST
Header: Authrization: {token}
Body: {directory: "directory"}
Return: success (string)
Error: 401 (authorized failed)
          400 (miss parameters)
          500 (can not play this file)
2. Asynchronous Play Audio
Description:This API can be used to play audio
URI: /audio/play
Method: PUT
Header: Authrization: {token}
Body: {directory: "directory"}
Return: success (string)
Error: 401 (authorized failed)
          400 (miss parameters)
          500 (can not play this file)
3. Force to Stop Play Audio
Description:This API can be used to force to stop play audio.
URI: /audio/play
Method: DELETE
Header: Authrization: {token}
Return: success
Error: 401 (authorized failed)
4. Open Recorder
Description:This API can be used to open recorder device
URI: /recorder
Method: PUT
Header: Authrization: {token}
Body:
Return: success (string)
Error: 401 (authorized failed)
          500 (open recorder failed)
5. Close Recorder
Description:This API can be used to colse recorder device
URI: /recorder
Method: DELETE
Header: Authrization: {token}
Body:
Return: success (string)
Error: 401 (authorized failed)
          500 (close recorder failed)
6. Record Audio
Description:This API can be used to record an audio segment.
URI: /audio/record
Method: POST
Header: Authrization: {token}
Body: {"humanonly": true/false, directory: "directory", maxtime: maxtime} * maxtime means max record time, default 10s
Return: success
Error: 401 (authorized failed)
          400 (miss parameters/parameter is illegal)
          500 (time out, no sentence found)
6. Record Serial Audios Looping
Description:This API can be used to record serial audios by time duration.
URI: /audios/record
Method: PUT(Asynchronous)
Header: Authrization: {token}
Body: {directory: "directory", prename: "prename", bufsize: "bufsize", looptime: "looptime", recordtime: "recordtime"} * looptime means time duration of loop, recordtime means time duration of one record file, recordtime should less then looptime
Return: success
Error: 401 (authorized failed)
          400 (miss parameters/parameter is illegal)
          500 (can not stop pre-record-thread)
7. Stop Record Serial Audios Looping
Description:This API can be used to stop the record serial audios looping.
URI: /audios/record
Method: DELETE
Header: Authrization: {token}
Return: success
Error: 401 (authorized failed)