this code is go server for project hearsitter, solution challenge.
this code is made with golang and fiber framework. also grpc is used for connecting python server.
when application send http request to this server with sound file, this server send the file to python server. the python server can figure out what kind of sound was send, and can figure out if warning is needed. this server send sound file to python server with grpc. after knowing what sound it was, this server sends results to client including sound prediction, status of sync, alarm if warning is needed.
this server just routes sound file, this server can load balance.
using | method | url | body | response |
---|---|---|---|---|
check server alive | get | '/' | - | Hello world! |
check python server alive | get | '/ping' | - | Pong! |
send sound file to analyze | post | '/file' | sound file(wav) | {"Alarm":boolean, "Label":String, "Tagging_rate":float} |
send sound byte[] to analyze | post | '/uint' | sound file as byte[] | {"Alarm":boolean, "Label":String, "Tagging_rate":float} |
if Alarm is true, the warning is needed. Label tell us which the sound sounds like.
landing page https://github.com/mumwa/hearsitter-landingpage
go fiber https://gofiber.io/