When storing binary data, use the LargeBinary
type. Despite its name, it is appropriate for any sized binary data.
data = db.Column(db.LargeBinary)
Read the data from the uploaded file in your Flask view.
audio.data = request.files['data'].read()
Rather than storing the data in the database, it's typically better to store files in the filesystem, and store the path to the file in the database.
Since you're presumably serving these files, not just storing them, it is much more efficient to serve the files from the filesystem. See this answer for more discussion on serving data from the database.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…