Keep the audio file inside a folder "sounds"
char *audio_path = "sounds/";
then compile and run the 'updateDatabase.c' file gcc -o updateDB updateDatabase.c
and ./updateDB
, this will create a SQLite DB file called file_data.db
that contains the audio files meta data
gcc clrfnc.c dbfnc.c fileio.c stdfnc.c main.c -o MainServer -lsqlite3
./MainServer
if (strcmp(req->route, "/files") == 0)
this route /files respond back a JSON contains the audio file id and file name ,
[{"FA37jNCchRYdSBZA":"file name"}]
use this route /audio/:id , the id is from the JSON and this route will respond back with base64 encoded string of audio file corresponded to the audio id