Save audio file to database

I’m currently working on a script where we can record audio and have it listened to by others.

I can record and listen to audio using javascript and html. But the things I want are:

1: sound recordings must somehow run in lua code (the 3d sound library I use is run from lua.)

2: I must somehow keep the audio file so that it will not be deleted on restart.

You’d probably want to save it as a file, or upload it somewhere.
Afaik, storing an actual audio file would not really be ideal for an SQL database.

Dont’t save audio files to the database you’re likely to experience issues with doing that. Create a folder somewhere in your file structure to save the recordings into in a physical format (something like /[resource]/files/audio/), then use the Lua I/O functions from the serverside in order to save, edit, and load these files as needed. Lua - File I/O

i didn’t understand. if u say “don’t save to database” okay i am not. but i record my voice with javascript. how can i save this for don’t delete in restart.

Follow this guide to learn how to save an audio file to a .mp3 in JavaScript:

https://medium.com/jeremy-gottfrieds-tech-blog/javascript-tutorial-record-audio-and-encode-it-to-mp3-2eedcd466e78#:~:text=Encode%20An%20mp3%20File%20Using%20ffmpeg